🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

twitter-rss-server

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twitter-rss-server - npm Package Compare versions

Comparing version
0.5.0
to
1.0.1
+10
-56
bin/cmd.js

@@ -5,5 +5,3 @@ #!/usr/bin/env node

var path = require('path')
var prompt = require('prompt')
var rssTwitter = require('rss-twitter')
var configstore = require('configstore')
var rssTwitter = require('twitter-rss-noauth')

@@ -15,61 +13,17 @@

var server = http.createServer(function (req, res) {
var user = req.url.substring(1)
var conf = new configstore('twitter-rss-server')
function startServer () {
var twitterApi = rssTwitter(conf.get('CONSUMER_KEY'), conf.get('CONSUMER_SECRET'), conf.get('ACCESS_TOKEN'), conf.get('ACCESS_SECRET'))
var server = http.createServer(function (req, res) {
var user = req.url.substring(1)
twitterApi.feed(user, function (err, feed) {
if (err) {
res.end(err)
} else {
res.end(feed.render('rss-2.0'))
}
})
})
server.listen(port, function () {
console.log('http://localhost:' + port)
})
}
function promptForKeys (cb) {
var fields = [
'CONSUMER_KEY',
'CONSUMER_SECRET',
'ACCESS_TOKEN',
'ACCESS_SECRET',
]
var missingFields = fields.filter(function (f) { return !conf.get(f) })
if (!missingFields.length) {
cb()
return
}
prompt.start()
prompt.get(missingFields, function (err, res) {
rssTwitter(user, function (err, feed) {
if (err) {
return process.exit(err)
res.end(err)
} else {
Object.keys(res).forEach(function (k) {
conf.set(k, res[k])
})
cb()
res.end(feed)
}
})
}
})
server.listen(port, function () {
console.log('http://localhost:' + port)
})
// Rewrite the path to use the global .config namespace.
conf.path = conf.path.replace(
path.join('configstore', 'twitter-rss-server.json'),
'twitter-rss-server/config.json')
// Prompt the user for keys if necessary, then start the server.
promptForKeys(startServer)
+2
-8
{
"name": "twitter-rss-server",
"version": "0.5.0",
"version": "1.0.1",
"description": "tiny server that hosts Twitter timelines as RSS feeds",

@@ -24,11 +24,5 @@ "bin": {

"dependencies": {
"configstore": "^1.2.1",
"minimist": "^1.2.0",
"prompt": "^0.2.14",
"//": [
"TODO(noffle): use mainline 'twitter-rss' once fixing PR is pulled in",
"(https://github.com/drei01/node-twitter-rss/pull/1)"
],
"rss-twitter": "https://github.com/noffle/node-twitter-rss"
"twitter-rss-noauth": "^0.1.1"
}
}

@@ -12,13 +12,2 @@ # twitter-rss-server

# setup
Twitter has chosen to put up barriers around their API, so you'll need to
[Create a Twitter App](https://apps.twitter.com/) to get a Consumer Key,
Consumer Secret Key, an Access Token, and an Access Token Secret. Oy vey.
Once you have these, you'll be asked for them on your first run of
`twitter-rss-server`. They'll be written as a JSON blob in your system's
configuration directory (`~/.config/configstore/twitter-rss-server` on \*nixes).
# usage

@@ -25,0 +14,0 @@

Sorry, the diff of this file is not supported yet