drummerSupport
drummerSupport copied to clipboard
Expanding (or viewing source for?) the standard library
I wrote a script this week (in Perl, not Drummer) that, given a Twitter username, returns the URL for that user’s Twitter avatar. I want to use it to populate my Contacts app with images for the contacts whose Twitter names I know.
Drummer’s built-in Twitter verbs are very easy to use. But alas, twitter.getUserInfo()
does not include the user’s image. How would I go about adding this? Is there a way I can add my own twitter
verbs and piggyback on the way that Drummer completely hides the need to deal with OAuth and Twitter developer credential keys and secrets? Is there a way to view source on the built-in standard library verbs?
@gruber -- I addressed this question two ways.
-
I added urlProfileImage to the struct that twitter.getUserInfo returns.
-
There's a new verb, twitter.getRawUserInfo that returns exactly the structure that Twitter sends us. So if there's other info you need that isn't in the simplified struct we use in Drummer you can get it.
Also the source for the twitter stuff is available, it's in the davetwitter package.
Fast work, @scripting. Thanks. Checking it out now.
Question: Are all Drummer users sharing a set of Twitter API credentials? Meaning, if one user runs a script that inadvertently triggers Twitter’s rate limiting, will all Drummer users be affected? Or are rate limits, etc., somehow tied per-user (perhaps because we’re all signed in via Twitter to use Drummer)?
@gruber -- thanks..
No we are not sharing one set of credentials.
We make the request using your credentials, remember, Drummer uses Twitter for identity.
Pretty much everything you do on the server is authenticated with the oAuth stuff.
So what you do, theoretically only affects your rate limits. Though they know what app is making the request of course, because Drummer is registered with Twitter.
BTW, it's fast work because I've been hungry for someone else to use this stuff.
When I tell people what I have working their eyes glaze over it seems.
The whole idea of scriptable apps is news to the web at large.