{"id":20775538,"url":"https://github.com/jamesfrost/gnip-rule-parser","last_synced_at":"2026-05-27T12:32:38.176Z","repository":{"id":57251538,"uuid":"98421458","full_name":"JamesFrost/gnip-rule-parser","owner":"JamesFrost","description":"Parse Twitter (GNIP) PowerTrack/Search rules into an abstract syntax tree.","archived":false,"fork":false,"pushed_at":"2018-08-09T10:57:12.000Z","size":408,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-18T02:49:08.514Z","etag":null,"topics":["gnip","gnip-powertrack","twitter","twitter-api","twitter-streaming-api"],"latest_commit_sha":null,"homepage":"http://jamesfrost.me/gnip-rule-parser/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamesFrost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-26T12:41:43.000Z","updated_at":"2021-02-04T06:59:23.000Z","dependencies_parsed_at":"2022-09-06T19:22:04.862Z","dependency_job_id":null,"html_url":"https://github.com/JamesFrost/gnip-rule-parser","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesFrost%2Fgnip-rule-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesFrost%2Fgnip-rule-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesFrost%2Fgnip-rule-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesFrost%2Fgnip-rule-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesFrost","download_url":"https://codeload.github.com/JamesFrost/gnip-rule-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243114072,"owners_count":20238536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gnip","gnip-powertrack","twitter","twitter-api","twitter-streaming-api"],"created_at":"2024-11-17T12:37:13.078Z","updated_at":"2025-12-16T10:42:15.600Z","avatar_url":"https://github.com/JamesFrost.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gnip-rule-parser [![Build Status](https://travis-ci.org/JamesFrost/gnip-rule-parser.svg?branch=master)](https://travis-ci.org/JamesFrost/gnip-rule-parser)\nParse [GNIP PowerTrack/Search rules](https://developer.twitter.com/en/docs/tweets/rules-and-filtering/overview) into an abstract syntax tree. \n\n[Try the online demo here](http://jamesfrost.me/gnip-rule-parser/).\n\n*If you want to validate rules, I strongly suggest you use the [validation API endpoint](https://developer.twitter.com/en/docs/tweets/filter-realtime/api-reference/powertrack-stream#get-validation).*\n\n## Getting Started\n### Installation\n```bash\nnpm install --save gnip-rule-parser\n```\n### Running The Tests\n```bash\nmocha\n```\n### Usage\n```js\nvar parser = require( 'gnip-rule-parser' );\n\ntry\n{\n  var ast = parser.parse( 'happy OR party' );\n\n  console.log( ast ); \n}\ncatch( err )\n{ \n  // Rule isn't valid\n}\n```\n#### Output\n```bash\n[ \n  {\n    name: 'boolean',\n    value: 'OR',\n    leftBranch: \n    { \n      name: 'keyword', \n      value: 'happy' \n    },\n    rightBranch: \n    { \n      name: 'keyword', \n      value: 'party' \n    } \n  } \n]\n```\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesfrost%2Fgnip-rule-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesfrost%2Fgnip-rule-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesfrost%2Fgnip-rule-parser/lists"}