Initial commit

master
Sven Slootweg 7 years ago
commit b002c4e24f

1
.gitignore vendored

@ -0,0 +1 @@
node_modules

@ -0,0 +1,19 @@
# listenlogger
Quick-and-dirty tweet logger for listentotwitter.com.
Setup (after cloning the repository):
```
npm install
```
Usage:
```
node logger.js bbcdebate
```
... where `bbcdebate` is the query you want to listen for.
All data is output to stdout in newline-delimited JSON format, and can be redirected to a file, passed through `jq`, and so on.

@ -0,0 +1,18 @@
'use strict';
const socketIO = require("socket.io-client");
let client = socketIO.connect("http://ws.listentotwitter.com");
function heartbeat() {
client.emit('ping', {keyword: process.argv[2]});
}
client.on("tweet", (data) => {
console.log(JSON.stringify(data));
});
client.on("connect", () => {
heartbeat();
setInterval(heartbeat, 3000);
});

@ -0,0 +1,19 @@
{
"name": "listenlogger",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@git.cryto.net:joepie91/listenlogger.git"
},
"keywords": [],
"author": "Sven Slootweg",
"license": "WTFPL",
"dependencies": {
"socket.io-client": "^0.9.17"
}
}
Loading…
Cancel
Save