The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Tumblr Interface

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Tumblr Interface Posted: Jun 15, 2009 1:38 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Tumblr Interface
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

I've now implemented all of the stuff I need to do for the Tumblr API; it was pretty simple, and the usage is even simpler. I created a Post class, with one subclass per type of post Tumblr supports. To post the appropriate kind of thing, you just create that instance, fill in the instance variables, and execute it. Here's the way some example usage looks:


username := 'usernameHere'.
password := 'passwordHere'.
emailAddress := 'emailAddressHere'.

"regular post"
post := RegularPost new.
post email: emailAddress.
post password: password.
post tags: (Array with: 'smalltalk' with: 'tumblr').
post title: 'First Tumblr Post'.
post body: 'This should be posted to Tumblr'.
post post.

"edit a post - note that the post object should have the postId filled in now"
post email: emailAddress.
post password: password.
post title: 'First Tumblr Post'.
post body: 'We just edited the post'.
post post

"photo post"
post := PhotoPost new.
post email: emailAddress.
post password: password.
post tags: (Array with: 'smalltalk' with: 'tumblr' with: 'photo').
post caption: 'This is me presenting in Cologne, Germany'.
post clickThroughUrl: 'http://www.cincomsmalltalk.com/blog/blogView'.
post data: 'PathAndFilenameForPhoto.jpg'.
post post.

"quote post"
post := QuotePost new.
post email: emailAddress.
post password: password.
post tags: (Array with: 'smalltalk' with: 'tumblr' with: 'quote').
post quote: 'A fanatic is one who can''t change his mind and won''t change the subject.'.
post source: 'http://www.quotationspage.com/quotes/Sir_Winston_Churchill/'.
post post.

"link post"
post := LinkPost new.
post email: emailAddress.
post password: password.
post tags: (Array with: 'smalltalk' with: 'tumblr' with: 'link').
post url: 'http://www.cincomsmalltalk.com/scripts/CommunityDownloadPage.ssp'.
post name: 'Cincom Smalltalk NC Download'.
post description: 'Here''s the free Cincom Smalltalk Non-Commercial download - grab ObjectStudio 8.1 and/or VisualWorks 7.6'.
post post.


"authenticate - a misnomer, as it answers info on your permissions, does not authenticate you"
post := RegularPost new.
post email: emailAddress.
post password: password.
post authenticate.

"get the JSON read results"
post := RegularPost new.
post read: username


Read: Tumblr Interface

Topic: Reboot for Safari? Previous Topic   Next Topic Topic: Agile Coaching Beta release

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use