Lisplog

Blogging in Lisp

Search

Twitterrific

Submitted by Bill St. Clair on Thu, 23 Nov 2017 16:50:01 GMT

I recently started using Twitterrific, a Mac and iOS Twitter client. I like that it syncs between my iMac and iPhone, and its "Delete and Edit Tweet" feature, something that I occasionally do by hand in Twitter's interfaces, to fix a typo. But I'm missing a few features:

  1. Link previews.
    I follow some accounts that link to meme images, and seeing at least part of the image before clicking on it is handy.
  2. List retweeters of a Tweet. Twitterriffic shows a retweet count, but, unlike Twitter's clients, has no way to show the list of people who retweeted.
  3. List likers of a Tweet.
    Again, Twitterrific shows a like count, but has no way to show the list of likers.

I tweeted about the second and third issues above, and received this reply:

I can find no API for listing who likes a post, but there is definitely an API for reposters.

The examples below use twurl, Twitter's curl-like command line tool, that sends raw URLs to the Twitter API, does all the OATH validation for you, and returns the raw JSON.

First, show a recent Tweet from President Trump (long lines elided):

$ twurl '/1.1/statuses/show.json?id=933692459351265280&trim_user=1&include_entities=0'
{"created_at":"Thu Nov 23 13:43:24 +0000 2017",
 "id":933692459351265280,
 "id_str":"933692459351265280",
 "text":"Will be doing a live Thanksgiving Video Teleconference with Members of the Military...",
 "truncated":true,
 "source":"\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" ...",
 "in_reply_to_status_id":933662564587855877,
 "in_reply_to_status_id_str":"933662564587855877",
 "in_reply_to_user_id":25073877,
 "in_reply_to_user_id_str":"25073877",
 "in_reply_to_screen_name":"realDonaldTrump",
 "user":{"id":25073877,"id_str":"25073877"},
 "geo":null,
 "coordinates":null,
 "place":null,
 "contributors":null,
 "is_quote_status":false,
 "retweet_count":5122,
 "favorite_count":28375,
 "favorited":false,
 "retweeted":false,
 "lang":"en"
}

Look up the retweeters, limited to 5. The default, and maximum, is 100, though you can use a 'cursor' to fetch additional pages of 100.

$ twurl '/1.1/statuses/retweeters/ids.json?id=933692459351265280&count=5'
{"ids":[742479627592052736,2209081703,140410587,848195164673855490,3854255787],
 "next_cursor":0,
 "next_cursor_str":"0",
 "previous_cursor":0,
 "previous_cursor_str":"0"
}

Lookup details on one of those user IDs:

$ twurl '/1.1/users/lookup.json?user_id=140410587&include_entities=0'
[{"id":140410587,
  "id_str":"140410587",
  "name":"Trump supporter",
  "screen_name":"EdMendez1969",
  "location":"",
  "description":"El comunismo no debe existir en el planeta...",
  ...
 }]

I don't know why Twitter has no API to fetch the users who liked a post (which are called "favorites" in the API docs). You can get the posts liked by a user, but not the users who like a post. Unless you screen-scrape the web UI, which is fraught with peril, and no fun.

I hope this post will encourge the Twitterrific people to add to their clients the ability to show retweeters for a post.

Add comment   Edit post   Add post

Previous Posts:

iPhone X Ad Swirling Colorful Sand
Archmage Is Done!
MacOS High Sierra
Going Supersonic in Elon Musk's Test Hyperloop Tube
2017 iMac
Spokes is Done!
Spokes
Mirroring a Blogspot Site
Xossbow Progress Report
Diceware Passphrase Generator Updated