I am using the Twitter web-intents / javascript API, and I'm a bit surprised. What I'd like to do is listen for an event after a tweet occurs. Following their example:
twttr.events.bind('tweet', function(event) {
// Do something there
});
However, what I'd like to do is store the tweet id, or some other relevant information. If I take a look at the event
object, there doesn't appear to be any relevant information in the data
attribute.
Is it possible to obtain the tweet ID (or any other details about the tweet) by listening to a tweet event?
Today, Twitter IDs are unique 64-bit unsigned integers, which are based on time, instead of being sequential. The full ID is composed of a timestamp, a worker number, and a sequence number.
You can access specific tweets by their id with the statuses/show/:id API route. Most Python Twitter libraries follow the exact same patterns, or offer 'friendly' names for the methods. and the returned dictionary follows the Tweet object definition given by the API.
Essentially, Twitter assigns a unique ID to each person as they join the network. This ID is a number, and started at number 1, and is currently above 300 million. But: that doesn't mean that the current user ID specifies the exact number of users on the network.
Web Intent events exist as a mechanism to trigger functionality in your page, not a data API.
The tweet event gets fired to indicate that a Tweet has happened, but we don't provide identifying information through the event payload: Intents function on your site without a user authorizing you access to their account, and providing a Tweet ID for an anonymous user's action would implicitly provide you with their identity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With