From 1e85cf7563b6c4bacc099fdac579707dd22a3a20 Mon Sep 17 00:00:00 2001 From: Dylan Date: Wed, 19 Jul 2023 00:49:46 +0100 Subject: [PATCH] More API Documentation --- api.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ readme.md | 46 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 83 insertions(+), 10 deletions(-) create mode 100644 api.md diff --git a/api.md b/api.md new file mode 100644 index 0000000..497f34a --- /dev/null +++ b/api.md @@ -0,0 +1,47 @@ +## API + +The VXTwitter API currently returns information about tweets. If you want more functionality added, please [Open an issue!](https://github.com/dylanpdx/BetterTwitFix/issues) + +The following fields are returned: +```json +{ + "date": "Wed Oct 05 18:40:30 +0000 2022", // Date the tweet was posted + "date_epoch": 1664995230, // Epoch date the tweet was posted + "hashtags": ["so","cool"], // String of hashtags in the tweet (without the actual hashtag) + "likes": 21664, // the amount of likes the tweet has + "mediaURLs": [ // A url for any media in the tweet (videos, gifs, images) + "https://video.twimg.com/tweet_video/FeU5fh1XkA0vDAE.mp4", + "https://pbs.twimg.com/media/FeU5fhPXkCoZXZB.jpg" + ], + "media_extended": [ // More detailed information about media + { // image: + "altText": "picture of Kermit doing a one legged stand on a bicycle seat riding through the park", // Alt text for the image or video, usually typed in by the poster of the tweet + "size": { // Width and Height of the original image + "height": 1007, + "width": 1179 + }, + "thumbnail_url": "https://pbs.twimg.com/media/FeU5fhPXkCoZXZB.jpg", // For images, this is the same as 'url' + "type": "image", // type of the media, can be 'image' or 'video' + "url": "https://pbs.twimg.com/media/FeU5fhPXkCoZXZB.jpg" // direct URL to the media + }, + { + "altText": "GIF of Laura Dern in Jurassic Park as Dr. Ellie Sattler taking off her sunglasses in shock", + "duration_millis": 0, // duration of the video in milliseconds. This can be 0 if Twitter doesn't provide it (i.e gifs) + "size": { // Width and Height of the original video + "height": 206, + "width": 194 + }, + "thumbnail_url": "https://pbs.twimg.com/tweet_video_thumb/FeU5fh1XkA0vDAE.jpg", // Direct link to the video thumbnail + "type": "video", + "url": "https://video.twimg.com/tweet_video/FeU5fh1XkA0vDAE.mp4" // Direct MP4 link + }, + ], + "replies": 2911, // the amount of replies the tweet has + "retweets": 3229, // the amount of retweets the tweet has + "text": "whoa, it works\n\nnow everyone can mix GIFs, videos, and images in one Tweet, available on iOS and Android https://t.co/LVVolAQPZi", // the tweet's text + "tweetID": "1577730467436138524", // ID of the tweet as a string + "tweetURL": "https://twitter.com/Twitter/status/1577730467436138524", // a link to the tweet, without tracking parameters + "user_name": "Twitter", // Name of the user who posted the tweet. This CAN have spaces, emojis, etc. as it's not the 'handle' of the user. A good example is "Nintendo of America" + "user_screen_name": "Twitter" // The actual handle of the user, i.e "NintendoAmerica" +} +``` \ No newline at end of file diff --git a/readme.md b/readme.md index 3f7258c..d203236 100644 --- a/readme.md +++ b/readme.md @@ -14,25 +14,51 @@ Just replace twitter.com with vxtwitter.com on the link to the tweet! `https://t ## API If you're a nerd like me and want to use information about a tweet in your code, you can make a request to `api.vxtwitter.com` to get basic information about a tweet: -`https://api.vxtwitter.com/Twitter/status/1263145271946551300` +`https://api.vxtwitter.com/Twitter/status/1577730467436138524` ```json { - "date": "Wed May 20 16:31:15 +0000 2020", - "date_epoch": 1589992275, + "date": "Wed Oct 05 18:40:30 +0000 2022", + "date_epoch": 1664995230, "hashtags": [], - "likes": 60038, + "likes": 21664, "mediaURLs": [ - "https://video.twimg.com/amplify_video/1263145212760805376/vid/1280x720/9jous8HM0_duxL0w.mp4?tag=13" + "https://video.twimg.com/tweet_video/FeU5fh1XkA0vDAE.mp4", + "https://pbs.twimg.com/media/FeU5fhPXkCoZXZB.jpg" ], - "replies": 11720, - "retweets": 16729, - "text": "Testing, testing...\n\nA new way to have a convo with exactly who you want. We’re starting with a small % globally, so keep your 👀 out to see it in action. https://t.co/pV53mvjAVT", - "tweetID": "1263145271946551300", - "tweetURL": "https://twitter.com/Twitter/status/1263145271946551300", + "media_extended": [ + { + "altText": "GIF of Laura Dern in Jurassic Park as Dr. Ellie Sattler taking off her sunglasses in shock", + "duration_millis": 0, + "size": { + "height": 206, + "width": 194 + }, + "thumbnail_url": "https://pbs.twimg.com/tweet_video_thumb/FeU5fh1XkA0vDAE.jpg", + "type": "video", + "url": "https://video.twimg.com/tweet_video/FeU5fh1XkA0vDAE.mp4" + }, + { + "altText": "picture of Kermit doing a one legged stand on a bicycle seat riding through the park", + "size": { + "height": 1007, + "width": 1179 + }, + "thumbnail_url": "https://pbs.twimg.com/media/FeU5fhPXkCoZXZB.jpg", + "type": "image", + "url": "https://pbs.twimg.com/media/FeU5fhPXkCoZXZB.jpg" + } + ], + "replies": 2911, + "retweets": 3229, + "text": "whoa, it works\n\nnow everyone can mix GIFs, videos, and images in one Tweet, available on iOS and Android https://t.co/LVVolAQPZi", + "tweetID": "1577730467436138524", + "tweetURL": "https://twitter.com/Twitter/status/1577730467436138524", "user_name": "Twitter", "user_screen_name": "Twitter" } ``` +See [the following page](https://github.com/dylanpdx/BetterTwitFix/blob/main/api.md) for more info on the API + # **Note**: If you enjoy this service, please considering donating via [Ko-Fi](https://ko-fi.com/dylanpdx) to help cover server costs