Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add bin script

  • Loading branch information...
commit 015e348572ea3d027c66f364cc157eb09cff4905 1 parent b24045d
@tmpvar authored
Showing with 14 additions and 3 deletions.
  1. +10 −2 index.js
  2. +4 −1 package.json
View
12 index.js 100644 → 100755
@@ -1,3 +1,5 @@
+#!/usr/bin/env node
+
var
fs = require('fs'),
path = require('path'),
@@ -6,6 +8,11 @@ var
request = require('request'),
es = require('event-stream');
+if (!argv.filter) {
+ console.log('usage: twitter --filter="#hash,#tags" --regex="something"');
+ process.exit();
+}
+
fs.readFile(file, function(e, d) {
if (e) {
console.log("Please create a ~/.twitter-cli file with your creds")
@@ -44,10 +51,11 @@ fs.readFile(file, function(e, d) {
if (matches) {
callback(null, matches[0] + '\n');
}
- } else {
+ } else if (out) {
callback(null, out);
+ } else {
+ callback();
}
-
}),
process.stdout
);
View
5 package.json
@@ -1,6 +1,6 @@
{
"name": "twitter-cli",
- "version": "0.0.1",
+ "version": "0.0.2",
"description": "pump results from the twitter filter stream into stdout",
"main": "index.js",
"scripts": {
@@ -12,6 +12,9 @@
"cli",
"commandline"
],
+ "bin": {
+ "twitter": "index.js"
+ },
"author": "Elijah Insua <tmpvar@gmail.com>",
"license": "MIT",
"dependencies": {
Please sign in to comment.
Something went wrong with that request. Please try again.