Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update driver to reflect removal of user stream, and fix set hashtags #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ LABEL databox.type="app"
EXPOSE 8080

CMD ["npm","start"]
#CMD ["sleep","3000000"]
83 changes: 80 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,91 @@ This driver writes twitter event data into a store-json for later processing.

It saves the following streams of data:

1. twitterUserTimeLine - the logged in users timeline
2. twitterHashTagStream - tweets that contain #raspberrypi, #mozfest, #databox, #iot and #NobelPrize
1. twitterHashTagStream - tweets that contain #raspberrypi, #mozfest, #databox, #iot and #NobelPriz (hashtags can be changed in the driver settings)

These can then be accessed store-json API.

The driver used to provide the following from the user stream, but this
is no longer supported:

2. twitterUserTimeLine - the logged in users timeline
3. twitterDirectMessage - a list of the users' direct messages
4. twittrRetweet - a list of the users' retweets
5. twitterFavorite - a list of the users favourited

These can then be accessed store-json API.
The latter items can now only be accessed via webhooks, so not direct to
a NATed databox driver!

## A tweet

Here's an example tweet (i.e. what appears as the data: value):
```
{ created_at: 'Thu Oct 03 20:19:00 +0000 2019',
id: 1179853378215694300,
id_str: '1179853378215694336',
text: 'well, to be honest, quite of lot of time is trying to make databox work for #enablingtechnologies2019',
source: '<a href="https://mobile.twitter.com" rel="nofollow">Twitter Web App</a>',
truncated: false,
in_reply_to_status_id: null,
in_reply_to_status_id_str: null,
in_reply_to_user_id: null,
in_reply_to_user_id_str: null,
in_reply_to_screen_name: null,
user:
{ id: 1176966706696245200,
id_str: '1176966706696245249',
name: 'Chris Greenhalgh',
screen_name: 'ChrisGreenhal14',
location: null,
url: null,
description: null,
translator_type: 'none',
protected: false,
verified: false,
followers_count: 0,
friends_count: 0,
listed_count: 0,
favourites_count: 0,
statuses_count: 4,
created_at: 'Wed Sep 25 21:08:45 +0000 2019',
utc_offset: null,
time_zone: null,
geo_enabled: false,
lang: null,
contributors_enabled: false,
is_translator: false,
profile_background_color: 'F5F8FA',
profile_background_image_url: '',
profile_background_image_url_https: '',
profile_background_tile: false,
profile_link_color: '1DA1F2',
profile_sidebar_border_color: 'C0DEED',
profile_sidebar_fill_color: 'DDEEF6',
profile_text_color: '333333',
profile_use_background_image: true,
profile_image_url: 'http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png',
profile_image_url_https: 'https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png',
default_profile: true,
default_profile_image: false,
following: null,
follow_request_sent: null,
notifications: null },
geo: null,
coordinates: null,
place: null,
contributors: null,
is_quote_status: false,
quote_count: 0,
reply_count: 0,
retweet_count: 0,
favorite_count: 0,
entities: { hashtags: [Array], urls: [], user_mentions: [], symbols: [] },
favorited: false,
retweeted: false,
filter_level: 'low',
lang: 'en',
timestamp_ms: '1570133940639' }
```

# Implementing OAuth in Databox

Expand Down
26 changes: 3 additions & 23 deletions databox-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest-version": 1,
"name": "driver-twitter",
"version": "0.3.1",
"version": "0.4.1",
"description": "A simple Databox driver to stream twitter data",
"author": "Anthony Brown <[email protected]> ()",
"license": "MIT",
Expand Down Expand Up @@ -38,35 +38,15 @@
},

"provides": [
{
"data-source-type": "twitterUserTimeLine",
"description": "Twitter user timeline data",
"store-type": "tsblob",
"schema": {}
},
{
"data-source-type": "twitterHashTagStream",
"description": "Twitter user hashtag data",
"store-type": "tsblob",
"schema": {}
},
{
"data-source-type": "twitterDirectMessage",
"description": "Twitter users direct messages",
"store-type": "tsblob",
"schema": {}
},
{
"data-source-type": "twitterFavourites",
"description": "Twitter users favourites tweets",
"store-type": "tsblob",
"schema": {}
"store-type": "ts/blob"
},
{
"data-source-type": "Test Actuator",
"description": "testActuator",
"store-type": "tsblob",
"schema": {}
"store-type": "ts/blob"
}
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"body-parser": "^1.18.3",
"express": "^4.16.3",
"modclean": "^2.1.2",
"node-databox": "^0.9.0",
"node-databox": "^0.10.7",
"oauth": "^0.9.15",
"pug": "^2.0.3",
"twit": "^2.2.10"
Expand Down
Loading