Bird
request to consume the Twitter API
A wrapper aroundExamples
A repo with examples can be viewed here.
Streams
Bird is just a wrapper around request. And request offers a stream interface and the standard Node callback interface. So Bird does this just as well.
Imagine an express route that returns a users home timeline as json. You can simply pipe the call to the response.
// assuming you have the users oauth credentialsBirdtimelines
Media
Uploading media is a 2-part process.
var options = oauth: consumer_key: 'XXXXXXXXXXXXXXXXXX' consumer_secret: 'XXXXXXXXXXXXXXX' token: 'XXXXXXXXXXXXXXXXXX' token_secret: 'XXXXXXXXXXXXXXXXX' media: 'path/to/filename' Birdmedia;
Routes
❯ node
> require('./index')
{ auth:
{ requestToken: ...,
accessToken: ... },
timelines:
{ home: ...,
mentions: ...,
user: ...,
retweetsOfMe: ... },
tweets:
{ retweets: ...,
show: ...,
oembed: ...,
retweeters: ...,
update: ...,
tweet: ...,
destroy: ...,
retweet: ...,
updateWithMedia: ... },
search: { tweets: ... },
messages:
{ index: ...,
sent: ...,
show: ...,
destroy: ...,
new: ... },
friends: { index: ..., list: ... },
friendships:
{ noRetweets: ...,
show: ...,
lookup: ...,
incoming: ...,
outgoing: ...,
create: ...,
destroy: ...,
update: ... },
followers: { index: ..., list: ... },
account:
{ settings: ...,
verify: ...,
banner: ...,
updateSettings: ...,
updateDeliveryDevice: ...,
updateProfile: ...,
updateProfileBackgroundImage: ...,
updateProfileColors: ...,
updateProfileImage: ...,
removeProfileBanner: ...,
updateProfileBanner: ... },
blocks:
{ list: ...,
index: ...,
create: ...,
destroy: ... },
users:
{ lookup: ...,
show: ...,
search: ...,
contributees: ...,
contributors: ...,
suggestionsWithSlug: ...,
suggestionsWithSlugMembers: ... },
favorites:
{ list: ...,
create: ...,
destroy: ... },
lists:
{ list: ...,
statuses: ...,
memberships: ...,
subscribers: ...,
showSubscribers: ...,
removeMember: ...,
createMember: ...,
removeSubscriber: ...,
createSubscriber: ... },
geo:
{ place: ...,
geocode: ...,
search: ...,
similarPlaces: ...,
createPlace: ... },
trends:
{ place: ...,
available: ...,
closest: ... },
spam: { report: ... },
help:
{ configuration: ...,
languages: ...,
privacy: ...,
tos: ... },
application: { rateLimits: ... } }
Author
Aaron Ackerman |