+22
-15
| #!/usr/bin/env node | ||
| 'use strict' | ||
| // Please don't misuse these - I would like to keep this module easy to use | ||
| // without requireing people to first create their own app om Twitter | ||
| var consumerKey = 'XncZh9GMO7nUOCtoNeD7HXRu8' | ||
| var consumerSecret = 'NTshMOR9ew0iLTSfnFcYhJxp9XOkilWRSnMVt9vmaDqmcRK3pY' | ||
| var fs = require('fs') | ||
@@ -16,3 +11,3 @@ var path = require('path') | ||
| var opn = require('opn') | ||
| var twitterPin = require('twitter-pin')(consumerKey, consumerSecret) | ||
| var TwitterPin = require('twitter-pin') | ||
| var debug = require('debug')('tweetcat') | ||
@@ -22,6 +17,7 @@ var tweetcat = require('./') | ||
| var remote = process.argv[2] | ||
| var confFile = path.join(process.cwd(), process.argv[3]) || | ||
| path.join(userHome, '.config', 'tweetcat.json') | ||
| var confFile = process.argv[3] ? | ||
| path.join(process.cwd(), process.argv[3]) : | ||
| path.join(userHome, '.config', 'tweetcat.json') | ||
| if (!remote) return error('Usage: tweetcat [username]') | ||
| if (!remote) return error('Usage: tweetcat <username>') | ||
| if (remote === '--init') return init() | ||
@@ -32,4 +28,2 @@ if (!fs.existsSync(confFile)) return error('ERROR: tweetcat not initialized! Run `tweetcat --init`') | ||
| var conf = require(confFile) | ||
| conf.consumerKey = consumerKey | ||
| conf.consumerSecret = consumerSecret | ||
| debug('loaded conf', conf) | ||
@@ -40,7 +34,19 @@ | ||
| function init () { | ||
| authorize(function (err, conf) { | ||
| read({ prompt: 'Twitter Consumer Key:' }, function (err, key) { | ||
| if (err) return error(err) | ||
| setConf(conf, function (err) { | ||
| read({ prompt: 'Twitter Consumer Secret:' }, function (err, secret) { | ||
| if (err) return error(err) | ||
| console.log('tweetcat initialized - now run `tweetcat [username]`') | ||
| authorize(key, secret, function (err, conf) { | ||
| if (err) return error(err) | ||
| conf.consumerKey = key | ||
| conf.consumerSecret = secret | ||
| setConf(conf, function (err) { | ||
| if (err) return error(err) | ||
| console.log('tweetcat initialized - now run `tweetcat [username]`') | ||
| }) | ||
| }) | ||
| }) | ||
@@ -58,4 +64,5 @@ }) | ||
| function authorize (cb) { | ||
| function authorize (key, secret, cb) { | ||
| debug('requesting auth url from twitter...') | ||
| var twitterPin = TwitterPin(key, secret) | ||
| twitterPin.getUrl(function (err, url) { | ||
@@ -62,0 +69,0 @@ if (err) return cb(err) |
+3
-3
| { | ||
| "name": "tweetcat", | ||
| "version": "0.0.7", | ||
| "version": "0.0.8", | ||
| "description": "p2p pipe across the internet using Twitter as a transport stream", | ||
@@ -47,5 +47,5 @@ "main": "index.js", | ||
| "coordinates": [ | ||
| 18.4786257, | ||
| -69.9548902 | ||
| 55.7655328, | ||
| 12.5966409 | ||
| ] | ||
| } |
+16
-3
@@ -13,6 +13,19 @@ # tweetcat | ||
| ## Usage | ||
| ## Setup | ||
| First initialize: | ||
| Before you can use tweetcat you need to create an app on Twitter. Follow | ||
| the steps below to get started (you need to have a phone number | ||
| associated with your Twitter account). | ||
| 1. [Create a new app](https://apps.twitter.com/app/new) | ||
| 1. Choose a unique name, e.g. `tweetcat-<github-username>` | ||
| 1. Put in a dummy website, e.g. `http://example.com` | ||
| 1. Leave Callback URL blank | ||
| 1. When the application have been created you should be taken to the app | ||
| page. From here, click 'Keys and Access Token' and note the 'Consumer | ||
| Key' and the 'Consumer Secret' | ||
| When you've successfully created the Twitter app, continue with | ||
| initialization: | ||
| ``` | ||
@@ -22,3 +35,3 @@ tweetcat --init | ||
| Then run: | ||
| ## Usage | ||
@@ -25,0 +38,0 @@ ``` |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
11340
6.35%212
1.92%54
31.71%