Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

birdwatch

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

birdwatch - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

5

dist/index.js

@@ -17,2 +17,4 @@ 'use strict';

var _events = require('events');
var _objectAssign = require('object-assign');

@@ -22,4 +24,2 @@

var _events = require('events');
var _hashRegex = require('hash-regex');

@@ -152,2 +152,3 @@

self.feeds.push({ screenname: feed.screenname, options: options });
return _Promise.resolve();
})));

@@ -154,0 +155,0 @@

21

dist/report.js
'use strict';
var chalk = require('chalk');

@@ -28,22 +29,2 @@ var version = require('./../package').version;

module.exports.logError = function (message, exit) {
if (message.join) {
message = message.join('\n');
}
console.log(chalk.red('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'));
console.log(chalk.red('ERROR!'));
console.log(chalk.white(message));
console.log(chalk.red('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n'));
if (exit === true) {
process.exit(1);
}
};
module.exports.reportSuccessMessageWithTime = function (message) {
console.log(chalk.cyan('\nSUCCESS: ') + message);
console.log(chalk.gray(new Date()));
console.log();
};
module.exports.processBirdwatchingMessage = function () {

@@ -50,0 +31,0 @@ console.log(chalk.cyan('\nLet\'s go Birdwatching!') + ' ' + chalk.gray(new Date()));

@@ -20,2 +20,10 @@ 'use strict';

var _fs = require('fs');
var _fs2 = _interopRequireDefault(_fs);
var _path = require('path');
var _path2 = _interopRequireDefault(_path);
var _objectAssign = require('object-assign');

@@ -33,6 +41,2 @@

var _report = require('./report');
var _report2 = _interopRequireDefault(_report);
var _mkdirp = require('mkdirp');

@@ -46,6 +50,2 @@

var _path = require('path');
var _path2 = _interopRequireDefault(_path);
var _pify = require('pify');

@@ -55,8 +55,6 @@

var _fs = require('fs');
var _report = require('./report');
var _fs2 = _interopRequireDefault(_fs);
var _report2 = _interopRequireDefault(_report);
var server = require('express')();
/**

@@ -68,2 +66,4 @@ * Process the feeds by starting the promise chain.

var server = require('express')();
function processFeeds(feeds) {

@@ -86,4 +86,5 @@ var self;

return context$1$0.abrupt('return', _Promise.all(feeds.map(function (feed, index) {
new _Promise(function callee$2$0(resolve) {
context$1$0.next = 6;
return _regeneratorRuntime.awrap(_Promise.all(feeds.map(function (feed, index) {
return new _Promise(function callee$2$0(resolve) {
var options, screenname;

@@ -126,3 +127,3 @@ return _regeneratorRuntime.async(function callee$2$0$(context$3$0) {

case 5:
case 6:
case 'end':

@@ -129,0 +130,0 @@ return context$1$0.stop();

{
"name": "birdwatch",
"version": "3.0.0",
"version": "3.0.1",
"description": "Monitor, filter, cache and serve specific twitter feeds.",

@@ -14,4 +14,6 @@ "main": "dist/index.js",

"scripts": {
"test": "xo && npm run build && ava",
"build": "babel lib --out-dir=dist --optional=runtime"
"test": "xo && npm run build && ava && nyc ava",
"ava": "npm run build && ava --verbose",
"build": "babel lib --out-dir=dist --optional=runtime",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},

@@ -69,3 +71,5 @@ "repository": {

"babel": "^5.8.23",
"coveralls": "^2.11.6",
"got": "^6.1.1",
"nyc": "^5.6.0",
"pify": "^2.3.0",

@@ -82,7 +86,4 @@ "rimraf": "^2.5.1",

"local-config.js"
],
"rules" : {
"no-new": 0
}
]
}
}

@@ -6,7 +6,6 @@ # Birdwatch :baby_chick::watch:

[![Build Status](https://travis-ci.org/radiovisual/birdwatch.svg?branch=master)](https://travis-ci.org/radiovisual/birdwatch)
[![Build Status](https://travis-ci.org/radiovisual/birdwatch.svg?branch=master)](https://travis-ci.org/radiovisual/birdwatch) [![Coverage Status](https://coveralls.io/repos/github/radiovisual/birdwatch/badge.svg?branch=master)](https://coveralls.io/github/radiovisual/birdwatch?branch=master)
Birdwatch will help you grab tweets from specific twitter accounts, and cache the tweets on your server,
thus avoiding any request limits set by the Twitter API, and giving you more control over the data that is saved.
**You can filter tweets by hashtags, or ignore retweets!**
thus avoiding any request limits set by the Twitter API, and giving you more control over the data that is saved (filter tweets by hashtag, ignore retweets, custom sorting options, etc). Use the built-in server to get you up and running quickly, or switch the server off and use the cache file anyway you like.

@@ -26,3 +25,3 @@ **Note:** This is a work in progress. If you find any bugs, or have suggestions [please report them](https://github.com/radiovisual/birdwatch/issues). If you want to help, pull requests are always appreciated!

3. Rename the file to `local-config.js`
4. *Now you're ready to birdwatch!* :baby_chick: :bowtie:
4. *Now you're ready to birdwatch!* :bowtie:

@@ -36,7 +35,7 @@ ## Usage

.feed('justinbieber')
.feed('taylorswift13', {filterTags:['tagOne', 'tagTwo']})
.start()
.then(tweets => {
console.log('birdwatch is ready to serve %s tweets', tweets.length);
});
.feed('taylorswift13', {filterTags:['tagOne', 'tagTwo']})
.start()
.then(tweets => {
console.log('birdwatch is ready to serve %s tweets', tweets.length);
});
```

@@ -51,9 +50,11 @@

### Cached HTML Tweet
If birdwatch can't find an `html` string on the returned tweet data, (which is sometimes the default from the Twitter API), then one will be rebuilt and added for you via [tweet-patch](https://github.com/radiovisual/tweet-patch). This means the **plaintext** hashtags, user-mentions and hyperlinks are converted back to twitter-ready markup for you. ::heart_eyes:: (You're welcome) Example below.
If birdwatch can't find an `html` string on the returned tweet data, (which is sometimes the default from the Twitter API), then one will be rebuilt and added for you via [tweet-patch](https://github.com/radiovisual/tweet-patch). This means that **_plaintext_** hashtags, user-mentions and hyperlinks are converted back into twitter-ready html for you (you're welcome). :heart_eyes:
```js
cached_tweets[0].text;
const tweet = cached_tweets[0];
tweet.text;
//=> "This is the #plaintext tweet"
cached_tweets[0].html;
tweet.html;
//=> "This is the <a href="https://twitter.com/hashtag/plaintext">#plaintext</a> tweet"

@@ -64,10 +65,10 @@ ```

Birdwatch v3 comes equipped with it's own built-in server. You don't have to configure the server at all, it will launch just fine using the defaults, but in case you need more control, you can configure the server by:
Birdwatch v3 comes equipped with its own built-in server. You don't have to configure the server at all, it will launch just fine using the defaults, but in case you need more control, you can configure the server by:
- [Turning it on or off](https://github.com/radiovisual/birdwatch#server) using the `server: <true|false>` option.
- [Override the url to the Birdwatch cache](https://github.com/radiovisual/birdwatch#cacheDir) with the `cacheDir: <path>` option
- [Specify the port](https://github.com/radiovisual/birdwatch#port) you want the server to run on with the `port: <portnumber>` option
- [Optionally serve test data](https://github.com/radiovisual/birdwatch#testData) in a JSON format using the `testData: <json>` option
- [Turning it on or off](https://github.com/radiovisual/birdwatch#server) using the `server: <true|false>` option
- [Overriding the url to the Birdwatch cache](https://github.com/radiovisual/birdwatch#cacheDir) with the `cacheDir: <path>` option
- [Specifying the port](https://github.com/radiovisual/birdwatch#port) you want the server to run on with the `port: <portnumber>` option
- [Optionally serving test data](https://github.com/radiovisual/birdwatch#testData) in a JSON format using the `testData: <json>` option
**Tip:** If you have your own caching server, just turn the Birdwatch server off, and feed your server the Birdwatch cache file.
**Tip:** The cache file is created even if the server is turned off, this means you can use Birdwatch with your own caching server: just turn the Birdwatch server off, and use the cache file however you want.

@@ -74,0 +75,0 @@ ## API

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc