SlideShare a Scribd company logo
1 of 11
Download to read offline
Progamming to the Twitter API
(ReTweeter)
Bar Camp Boston 3
May 18, 2008
John Eckman, jeckman@optaros.com
Agenda

  Twitter
  The Twitter API
  ReTweeter
  Lessons Learned
  Q&A




This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License   2
Twitter

  Lightweight micro-blogging platform
   • Short (<140) text messages to followers
   • River of updates from those you follow (friends)
  Some conventions:
   • d username = direct message
   • @username = reply
       – Unlike DMs, replies are public
       – User determines whether to see replies from
         folks not followed
   • #tag = hashtag (twemes.com, hashtags.org)
  Multiple modes of access
   • Mobile (SMS or Mobile Web)
   • Web Browser
   • Other Client (Using API)


This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License   3
The Twitter API

   Most access to Twitter is via the API
    • 10x more than the Web interface)
      (http://readwritetalk.com/2007/09/05/biz-stone-co-founder-twitter/)

      • Desktop clients like twhirl, twitterrific
      • Mobile clients TinyTwitter, PocketTweets, iTweet
   Well documented in Google Group
(http://groups.google.com/group/twitter-development-talk/web/api-documentation)

   Provides access to core data simply
    • XML, JSON data formats
    • RSS, ATOM syndication formats
   Basic http authentication where needed
   Rate limited
    • On reads (gets):
    • Unlimited writes (posts)


 This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License   4
The Twitter API: Basic Methods

  Status Methods:                                            User Methods:
     • public_timeline                                          • friends
     • friends_timeline                                         • followers
     • user_timeline                                            • featured
     • show                                                     • show
     • update                                                Direct Message Methods:
     • replies                                                  • direct_messages
     • destroy                                                  • sent
  Account Methods:                                              • new
     • verify_credentials                                       • destroy
     • end_session                                           Friendship Methods:
     • archive                                                  • create
     • update_location                                          • destroy
     • update_delivery_device                                   • exists




This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License   5
The Twitter API: Continued

  Favorite Methods:                                          Notification Methods:
     • favorites                                                • follow
     • create                                                   • leave
     • destroy                                               Block Methods
  Help Methods:                                                 • create
                                                                • destroy
     • test
     • downtime_schedule




This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License   6
ReTweeter

  Use the Twitter API to fake “group” functions
  Create a new “group” account
  Follow back folks who follow that account
  When those users tweet with a hashtag, repost that
  tweet so that all followers see it, prefaced with the
  username of the original poster
  Could have sent direct messages instead
  Hashtag could be the name of the account but doesn't
  have to be




This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License   7
ReTweeter Basic Flow of Code

   Whole thing runs on a cron job
      • Rate limiting – 70 requests in 60 minutes
      • Unlimited posting
   Get friends_timeline.xml
Returns the 20 most recent statuses posted in the last 24 hours from the
   authenticating user and that user's friends.
      curl -u email:password
        http://twitter.com/statuses/friends_timeline.xml
   Loop through posts in friends_timeline
      • Remove the group account itself (avoid loop!!)
      • Find all tweets in timeline beginning with hashtag
      • Put in database, with datestamp and id
   Pull all “un-retweeted” tweets from database
   Post those tweets, updating “retweeted” status as they
   post

 This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License   8
ReTweeter Code

  Time allowing, we'll look at the code
  Otherwise you can get it later:
     http://www.openparenthesis.org/code/twitter-api
  Open Source, GPLv3 license
  Uses:
     • PHP 5 (SimpleXMLElement rocks)
     • MySQL DB
     • cron or equivalent (scheduled command line invocation)
     • cURL




This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License   9
Lessons Learned

  Don't Test on the Live Account
     • Bad developer spams his followers
     • If they use SMS, this can have an actual financial cost in addition
       to annoyance
     • Thankfully people are forgiving, generally
  Use a desktop client like Twhirl
     • Multiple client support
     • Talk amongst yourselves
  Twitter will go down
     • Not if, but when
     • Handle errors gracefully
  Twitter can enable “auto-follow-back” for you
     • Sometimes following people fails for undetermined reasons
     • Since the group account can't follow them back they can't post!



This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License   10
Q&A

eckman.john@gmail.com
jeckman@optaros.com
http://twitter.com/jeckman


http://johneckman.com/ (lifestream, profile links)
http://www.openparenthesis.org/ (open source, web
  development, social applications)
http://www.goatless.org/ (travel, veganism, music)
http://www.optaros.com/user/jeckman (enterprise
  focus, how changes in the online industry affect
  Optaros clients and prospects)




This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License   11

More Related Content

What's hot

8 Most Common Joomla! Hacks and How to Avoid Them
8 Most Common Joomla! Hacks and How to Avoid Them8 Most Common Joomla! Hacks and How to Avoid Them
8 Most Common Joomla! Hacks and How to Avoid ThemDaniel Kanchev
 
Earn $3000+ with autoblogs using free traffic
Earn $3000+ with autoblogs using free trafficEarn $3000+ with autoblogs using free traffic
Earn $3000+ with autoblogs using free trafficAdam Jacob
 
WordPress Standardized Loop API
WordPress Standardized Loop APIWordPress Standardized Loop API
WordPress Standardized Loop APIChris Jean
 
Bootstrap 3 in Joomla!
Bootstrap 3 in Joomla!Bootstrap 3 in Joomla!
Bootstrap 3 in Joomla!Hans Kuijpers
 
BMPR - February 2010 Tips & Tricks
BMPR - February 2010 Tips & TricksBMPR - February 2010 Tips & Tricks
BMPR - February 2010 Tips & TricksBMPR
 
Seo Wordpress Blogs
Seo Wordpress BlogsSeo Wordpress Blogs
Seo Wordpress BlogsRon Edrote
 
Joomla 1, Joomla 2, Joomla 3 (Joomla Versions Explained)
Joomla 1, Joomla 2, Joomla 3 (Joomla Versions Explained)Joomla 1, Joomla 2, Joomla 3 (Joomla Versions Explained)
Joomla 1, Joomla 2, Joomla 3 (Joomla Versions Explained)Sander Potjer
 
Beginning WordPress Plugin Development
Beginning WordPress Plugin DevelopmentBeginning WordPress Plugin Development
Beginning WordPress Plugin DevelopmentAizat Faiz
 
15 Most Common WordPress Errors and Solution
15 Most Common WordPress Errors and Solution15 Most Common WordPress Errors and Solution
15 Most Common WordPress Errors and Solutionkethyjewel
 
Squarespace Site Shack Training -11-05-2015
Squarespace Site Shack Training -11-05-2015Squarespace Site Shack Training -11-05-2015
Squarespace Site Shack Training -11-05-2015Judy Wilson
 
Comparing Blogger And Wordpress
Comparing Blogger And WordpressComparing Blogger And Wordpress
Comparing Blogger And Wordpressigorgentry
 
Joomla! Plugin Development
Joomla! Plugin DevelopmentJoomla! Plugin Development
Joomla! Plugin DevelopmentYireo
 
Joomla Tomorrow and Beyond
Joomla Tomorrow and BeyondJoomla Tomorrow and Beyond
Joomla Tomorrow and BeyondJessica Dunbar
 
MA Magazines: City Uni - Further Wordpress customisations, process and plugin...
MA Magazines: City Uni - Further Wordpress customisations, process and plugin...MA Magazines: City Uni - Further Wordpress customisations, process and plugin...
MA Magazines: City Uni - Further Wordpress customisations, process and plugin...Dan Davies
 
Jason Tucker Wordpress 3rd Party Web Services
Jason Tucker Wordpress 3rd Party Web ServicesJason Tucker Wordpress 3rd Party Web Services
Jason Tucker Wordpress 3rd Party Web ServicesJason Tucker
 

What's hot (20)

8 Most Common Joomla! Hacks and How to Avoid Them
8 Most Common Joomla! Hacks and How to Avoid Them8 Most Common Joomla! Hacks and How to Avoid Them
8 Most Common Joomla! Hacks and How to Avoid Them
 
Earn $3000+ with autoblogs using free traffic
Earn $3000+ with autoblogs using free trafficEarn $3000+ with autoblogs using free traffic
Earn $3000+ with autoblogs using free traffic
 
WordPress Standardized Loop API
WordPress Standardized Loop APIWordPress Standardized Loop API
WordPress Standardized Loop API
 
Bootstrap 3 in Joomla!
Bootstrap 3 in Joomla!Bootstrap 3 in Joomla!
Bootstrap 3 in Joomla!
 
Killer word press-checklist
Killer word press-checklistKiller word press-checklist
Killer word press-checklist
 
BMPR - February 2010 Tips & Tricks
BMPR - February 2010 Tips & TricksBMPR - February 2010 Tips & Tricks
BMPR - February 2010 Tips & Tricks
 
Seo Wordpress Blogs
Seo Wordpress BlogsSeo Wordpress Blogs
Seo Wordpress Blogs
 
Joomla 1, Joomla 2, Joomla 3 (Joomla Versions Explained)
Joomla 1, Joomla 2, Joomla 3 (Joomla Versions Explained)Joomla 1, Joomla 2, Joomla 3 (Joomla Versions Explained)
Joomla 1, Joomla 2, Joomla 3 (Joomla Versions Explained)
 
Beginning WordPress Plugin Development
Beginning WordPress Plugin DevelopmentBeginning WordPress Plugin Development
Beginning WordPress Plugin Development
 
Seo Wordpress Blogs
Seo Wordpress BlogsSeo Wordpress Blogs
Seo Wordpress Blogs
 
15 Most Common WordPress Errors and Solution
15 Most Common WordPress Errors and Solution15 Most Common WordPress Errors and Solution
15 Most Common WordPress Errors and Solution
 
Squarespace Site Shack Training -11-05-2015
Squarespace Site Shack Training -11-05-2015Squarespace Site Shack Training -11-05-2015
Squarespace Site Shack Training -11-05-2015
 
Comparing Blogger And Wordpress
Comparing Blogger And WordpressComparing Blogger And Wordpress
Comparing Blogger And Wordpress
 
Joomla! Plugin Development
Joomla! Plugin DevelopmentJoomla! Plugin Development
Joomla! Plugin Development
 
Mobile web design
Mobile web designMobile web design
Mobile web design
 
Blog and search
Blog and searchBlog and search
Blog and search
 
Joomla Tomorrow and Beyond
Joomla Tomorrow and BeyondJoomla Tomorrow and Beyond
Joomla Tomorrow and Beyond
 
Pr7 8 clubwear-and-party-wear
Pr7 8 clubwear-and-party-wearPr7 8 clubwear-and-party-wear
Pr7 8 clubwear-and-party-wear
 
MA Magazines: City Uni - Further Wordpress customisations, process and plugin...
MA Magazines: City Uni - Further Wordpress customisations, process and plugin...MA Magazines: City Uni - Further Wordpress customisations, process and plugin...
MA Magazines: City Uni - Further Wordpress customisations, process and plugin...
 
Jason Tucker Wordpress 3rd Party Web Services
Jason Tucker Wordpress 3rd Party Web ServicesJason Tucker Wordpress 3rd Party Web Services
Jason Tucker Wordpress 3rd Party Web Services
 

Similar to Programming to the Twitter API: ReTweeter

Defeating Comment Spam
Defeating Comment SpamDefeating Comment Spam
Defeating Comment SpamAndrew Hedges
 
Community 2.0 Community Bootcamp: the technology part by Tara Hunt
Community 2.0 Community Bootcamp: the technology part by Tara HuntCommunity 2.0 Community Bootcamp: the technology part by Tara Hunt
Community 2.0 Community Bootcamp: the technology part by Tara HuntTara Hunt
 
OpenID Intro @ Barcamp Brussels 3
OpenID Intro @ Barcamp Brussels 3OpenID Intro @ Barcamp Brussels 3
OpenID Intro @ Barcamp Brussels 3Frank Louwers
 
Webspam (English Version)
Webspam (English Version)Webspam (English Version)
Webspam (English Version)Dirk Haun
 
How To Integrate Social Media Into Your Wordpress Site
How To Integrate Social Media Into Your Wordpress SiteHow To Integrate Social Media Into Your Wordpress Site
How To Integrate Social Media Into Your Wordpress SiteConvertiv
 
Leveraging Twitter Tools for Maximum Use
Leveraging Twitter Tools for Maximum UseLeveraging Twitter Tools for Maximum Use
Leveraging Twitter Tools for Maximum UseUrvi Mehta
 
Gates Toorcon X New School Information Gathering
Gates Toorcon X New School Information GatheringGates Toorcon X New School Information Gathering
Gates Toorcon X New School Information GatheringChris Gates
 
Citizen Happiness Workshop Part 2: The Building Blocks
Citizen Happiness Workshop Part 2: The Building BlocksCitizen Happiness Workshop Part 2: The Building Blocks
Citizen Happiness Workshop Part 2: The Building BlocksTara Hunt
 
Goodle Developer Days Madrid 2008 - Open Social Update
Goodle Developer Days Madrid 2008 - Open Social UpdateGoodle Developer Days Madrid 2008 - Open Social Update
Goodle Developer Days Madrid 2008 - Open Social UpdatePatrick Chanezon
 
Futuropolis 2058 Singapore - OpenSocial, a standard for the social web
Futuropolis 2058 Singapore - OpenSocial, a standard for the social webFuturopolis 2058 Singapore - OpenSocial, a standard for the social web
Futuropolis 2058 Singapore - OpenSocial, a standard for the social webPatrick Chanezon
 
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRF
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRFBe Afraid. Be Very Afraid. Javascript security, XSS & CSRF
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRFMark Stanton
 
Sourcer\'s Daily Dozen for ERE- Arbita JobMachine
Sourcer\'s Daily Dozen for ERE- Arbita JobMachineSourcer\'s Daily Dozen for ERE- Arbita JobMachine
Sourcer\'s Daily Dozen for ERE- Arbita JobMachineGlenn Gutmacher
 
Twitter for Archivists
Twitter for ArchivistsTwitter for Archivists
Twitter for ArchivistsLisa Grimm
 
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...amiable_indian
 
FOSDEM 2009 Thunderbird 3 talk
FOSDEM 2009 Thunderbird 3 talkFOSDEM 2009 Thunderbird 3 talk
FOSDEM 2009 Thunderbird 3 talkdavidascher
 

Similar to Programming to the Twitter API: ReTweeter (20)

Defeating Comment Spam
Defeating Comment SpamDefeating Comment Spam
Defeating Comment Spam
 
what is-twitter
what is-twitterwhat is-twitter
what is-twitter
 
Community 2.0 Community Bootcamp: the technology part by Tara Hunt
Community 2.0 Community Bootcamp: the technology part by Tara HuntCommunity 2.0 Community Bootcamp: the technology part by Tara Hunt
Community 2.0 Community Bootcamp: the technology part by Tara Hunt
 
Why HATEOAS
Why HATEOASWhy HATEOAS
Why HATEOAS
 
OpenID Intro @ Barcamp Brussels 3
OpenID Intro @ Barcamp Brussels 3OpenID Intro @ Barcamp Brussels 3
OpenID Intro @ Barcamp Brussels 3
 
Webspam (English Version)
Webspam (English Version)Webspam (English Version)
Webspam (English Version)
 
How To Integrate Social Media Into Your Wordpress Site
How To Integrate Social Media Into Your Wordpress SiteHow To Integrate Social Media Into Your Wordpress Site
How To Integrate Social Media Into Your Wordpress Site
 
Twitter Applications
Twitter ApplicationsTwitter Applications
Twitter Applications
 
Leveraging Twitter Tools for Maximum Use
Leveraging Twitter Tools for Maximum UseLeveraging Twitter Tools for Maximum Use
Leveraging Twitter Tools for Maximum Use
 
Gates Toorcon X New School Information Gathering
Gates Toorcon X New School Information GatheringGates Toorcon X New School Information Gathering
Gates Toorcon X New School Information Gathering
 
Citizen Happiness Workshop Part 2: The Building Blocks
Citizen Happiness Workshop Part 2: The Building BlocksCitizen Happiness Workshop Part 2: The Building Blocks
Citizen Happiness Workshop Part 2: The Building Blocks
 
Goodle Developer Days Madrid 2008 - Open Social Update
Goodle Developer Days Madrid 2008 - Open Social UpdateGoodle Developer Days Madrid 2008 - Open Social Update
Goodle Developer Days Madrid 2008 - Open Social Update
 
Seven Reasons for Code Bloat
Seven Reasons for Code BloatSeven Reasons for Code Bloat
Seven Reasons for Code Bloat
 
Futuropolis 2058 Singapore - OpenSocial, a standard for the social web
Futuropolis 2058 Singapore - OpenSocial, a standard for the social webFuturopolis 2058 Singapore - OpenSocial, a standard for the social web
Futuropolis 2058 Singapore - OpenSocial, a standard for the social web
 
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRF
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRFBe Afraid. Be Very Afraid. Javascript security, XSS & CSRF
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRF
 
Sourcer\'s Daily Dozen for ERE- Arbita JobMachine
Sourcer\'s Daily Dozen for ERE- Arbita JobMachineSourcer\'s Daily Dozen for ERE- Arbita JobMachine
Sourcer\'s Daily Dozen for ERE- Arbita JobMachine
 
Web 2.0 Expo
Web 2.0 ExpoWeb 2.0 Expo
Web 2.0 Expo
 
Twitter for Archivists
Twitter for ArchivistsTwitter for Archivists
Twitter for Archivists
 
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
 
FOSDEM 2009 Thunderbird 3 talk
FOSDEM 2009 Thunderbird 3 talkFOSDEM 2009 Thunderbird 3 talk
FOSDEM 2009 Thunderbird 3 talk
 

More from John Eckman

Don't fear the block: Gutenberg is gettin' good
Don't fear the block: Gutenberg is gettin' goodDon't fear the block: Gutenberg is gettin' good
Don't fear the block: Gutenberg is gettin' goodJohn Eckman
 
#NoStalking: Advertising & User Privacy
#NoStalking: Advertising & User Privacy#NoStalking: Advertising & User Privacy
#NoStalking: Advertising & User PrivacyJohn Eckman
 
There's a Reason We Call Them Institutions: Working in Higher Education Witho...
There's a Reason We Call Them Institutions: Working in Higher Education Witho...There's a Reason We Call Them Institutions: Working in Higher Education Witho...
There's a Reason We Call Them Institutions: Working in Higher Education Witho...John Eckman
 
Working the Open: Open Source in an Agency
Working the Open: Open Source in an AgencyWorking the Open: Open Source in an Agency
Working the Open: Open Source in an AgencyJohn Eckman
 
GDPR FTW, or, How I Learned to Stop Worrying and Love Privacy By Design
GDPR FTW, or, How I Learned to Stop Worrying and Love Privacy By DesignGDPR FTW, or, How I Learned to Stop Worrying and Love Privacy By Design
GDPR FTW, or, How I Learned to Stop Worrying and Love Privacy By DesignJohn Eckman
 
The Blob, the Chunk, & the Block: Structured Content in the Age of Gutenberg
The Blob, the Chunk, & the Block: Structured Content in the Age of GutenbergThe Blob, the Chunk, & the Block: Structured Content in the Age of Gutenberg
The Blob, the Chunk, & the Block: Structured Content in the Age of GutenbergJohn Eckman
 
Taking Back What and From Whom?: Imagined Communities and Role of WordPress i...
Taking Back What and From Whom?: Imagined Communities and Role of WordPress i...Taking Back What and From Whom?: Imagined Communities and Role of WordPress i...
Taking Back What and From Whom?: Imagined Communities and Role of WordPress i...John Eckman
 
Gutenberg for Agencies
Gutenberg for AgenciesGutenberg for Agencies
Gutenberg for AgenciesJohn Eckman
 
Engaging in Digital: Sites for Non-Profits
Engaging in Digital: Sites for Non-ProfitsEngaging in Digital: Sites for Non-Profits
Engaging in Digital: Sites for Non-ProfitsJohn Eckman
 
Dear Firstname Lastname: Personalization & Content Targeting
Dear Firstname Lastname: Personalization & Content TargetingDear Firstname Lastname: Personalization & Content Targeting
Dear Firstname Lastname: Personalization & Content TargetingJohn Eckman
 
But Why? Use Cases for the REST API
But Why? Use Cases for the REST APIBut Why? Use Cases for the REST API
But Why? Use Cases for the REST APIJohn Eckman
 
WPDrama & The Four Agreements
WPDrama & The Four AgreementsWPDrama & The Four Agreements
WPDrama & The Four AgreementsJohn Eckman
 
Distributed, not Disconnected: Employee Engagement for Remote Companies
Distributed, not Disconnected: Employee Engagement for Remote CompaniesDistributed, not Disconnected: Employee Engagement for Remote Companies
Distributed, not Disconnected: Employee Engagement for Remote CompaniesJohn Eckman
 
Disrupting Distribution
Disrupting DistributionDisrupting Distribution
Disrupting DistributionJohn Eckman
 
Managing Clients without Going Crazy
Managing Clients without Going CrazyManaging Clients without Going Crazy
Managing Clients without Going CrazyJohn Eckman
 
Stop Gathering Requirements - Start Defining Success
Stop Gathering Requirements - Start Defining SuccessStop Gathering Requirements - Start Defining Success
Stop Gathering Requirements - Start Defining SuccessJohn Eckman
 
Client Diplomacy: From Adversaries to Allies
Client Diplomacy: From Adversaries to AlliesClient Diplomacy: From Adversaries to Allies
Client Diplomacy: From Adversaries to AlliesJohn Eckman
 
WordPress as a CMS Platform: Gilbane 2015
WordPress as a CMS Platform: Gilbane 2015WordPress as a CMS Platform: Gilbane 2015
WordPress as a CMS Platform: Gilbane 2015John Eckman
 
WordPress and the Enterprise Disconnect
WordPress and the Enterprise DisconnectWordPress and the Enterprise Disconnect
WordPress and the Enterprise DisconnectJohn Eckman
 
The Future of WordPress (and Your Role In It)
The Future of WordPress (and Your Role In It)The Future of WordPress (and Your Role In It)
The Future of WordPress (and Your Role In It)John Eckman
 

More from John Eckman (20)

Don't fear the block: Gutenberg is gettin' good
Don't fear the block: Gutenberg is gettin' goodDon't fear the block: Gutenberg is gettin' good
Don't fear the block: Gutenberg is gettin' good
 
#NoStalking: Advertising & User Privacy
#NoStalking: Advertising & User Privacy#NoStalking: Advertising & User Privacy
#NoStalking: Advertising & User Privacy
 
There's a Reason We Call Them Institutions: Working in Higher Education Witho...
There's a Reason We Call Them Institutions: Working in Higher Education Witho...There's a Reason We Call Them Institutions: Working in Higher Education Witho...
There's a Reason We Call Them Institutions: Working in Higher Education Witho...
 
Working the Open: Open Source in an Agency
Working the Open: Open Source in an AgencyWorking the Open: Open Source in an Agency
Working the Open: Open Source in an Agency
 
GDPR FTW, or, How I Learned to Stop Worrying and Love Privacy By Design
GDPR FTW, or, How I Learned to Stop Worrying and Love Privacy By DesignGDPR FTW, or, How I Learned to Stop Worrying and Love Privacy By Design
GDPR FTW, or, How I Learned to Stop Worrying and Love Privacy By Design
 
The Blob, the Chunk, & the Block: Structured Content in the Age of Gutenberg
The Blob, the Chunk, & the Block: Structured Content in the Age of GutenbergThe Blob, the Chunk, & the Block: Structured Content in the Age of Gutenberg
The Blob, the Chunk, & the Block: Structured Content in the Age of Gutenberg
 
Taking Back What and From Whom?: Imagined Communities and Role of WordPress i...
Taking Back What and From Whom?: Imagined Communities and Role of WordPress i...Taking Back What and From Whom?: Imagined Communities and Role of WordPress i...
Taking Back What and From Whom?: Imagined Communities and Role of WordPress i...
 
Gutenberg for Agencies
Gutenberg for AgenciesGutenberg for Agencies
Gutenberg for Agencies
 
Engaging in Digital: Sites for Non-Profits
Engaging in Digital: Sites for Non-ProfitsEngaging in Digital: Sites for Non-Profits
Engaging in Digital: Sites for Non-Profits
 
Dear Firstname Lastname: Personalization & Content Targeting
Dear Firstname Lastname: Personalization & Content TargetingDear Firstname Lastname: Personalization & Content Targeting
Dear Firstname Lastname: Personalization & Content Targeting
 
But Why? Use Cases for the REST API
But Why? Use Cases for the REST APIBut Why? Use Cases for the REST API
But Why? Use Cases for the REST API
 
WPDrama & The Four Agreements
WPDrama & The Four AgreementsWPDrama & The Four Agreements
WPDrama & The Four Agreements
 
Distributed, not Disconnected: Employee Engagement for Remote Companies
Distributed, not Disconnected: Employee Engagement for Remote CompaniesDistributed, not Disconnected: Employee Engagement for Remote Companies
Distributed, not Disconnected: Employee Engagement for Remote Companies
 
Disrupting Distribution
Disrupting DistributionDisrupting Distribution
Disrupting Distribution
 
Managing Clients without Going Crazy
Managing Clients without Going CrazyManaging Clients without Going Crazy
Managing Clients without Going Crazy
 
Stop Gathering Requirements - Start Defining Success
Stop Gathering Requirements - Start Defining SuccessStop Gathering Requirements - Start Defining Success
Stop Gathering Requirements - Start Defining Success
 
Client Diplomacy: From Adversaries to Allies
Client Diplomacy: From Adversaries to AlliesClient Diplomacy: From Adversaries to Allies
Client Diplomacy: From Adversaries to Allies
 
WordPress as a CMS Platform: Gilbane 2015
WordPress as a CMS Platform: Gilbane 2015WordPress as a CMS Platform: Gilbane 2015
WordPress as a CMS Platform: Gilbane 2015
 
WordPress and the Enterprise Disconnect
WordPress and the Enterprise DisconnectWordPress and the Enterprise Disconnect
WordPress and the Enterprise Disconnect
 
The Future of WordPress (and Your Role In It)
The Future of WordPress (and Your Role In It)The Future of WordPress (and Your Role In It)
The Future of WordPress (and Your Role In It)
 

Recently uploaded

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Programming to the Twitter API: ReTweeter

  • 1. Progamming to the Twitter API (ReTweeter) Bar Camp Boston 3 May 18, 2008 John Eckman, jeckman@optaros.com
  • 2. Agenda Twitter The Twitter API ReTweeter Lessons Learned Q&A This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License 2
  • 3. Twitter Lightweight micro-blogging platform • Short (<140) text messages to followers • River of updates from those you follow (friends) Some conventions: • d username = direct message • @username = reply – Unlike DMs, replies are public – User determines whether to see replies from folks not followed • #tag = hashtag (twemes.com, hashtags.org) Multiple modes of access • Mobile (SMS or Mobile Web) • Web Browser • Other Client (Using API) This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License 3
  • 4. The Twitter API Most access to Twitter is via the API • 10x more than the Web interface) (http://readwritetalk.com/2007/09/05/biz-stone-co-founder-twitter/) • Desktop clients like twhirl, twitterrific • Mobile clients TinyTwitter, PocketTweets, iTweet Well documented in Google Group (http://groups.google.com/group/twitter-development-talk/web/api-documentation) Provides access to core data simply • XML, JSON data formats • RSS, ATOM syndication formats Basic http authentication where needed Rate limited • On reads (gets): • Unlimited writes (posts) This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License 4
  • 5. The Twitter API: Basic Methods Status Methods: User Methods: • public_timeline • friends • friends_timeline • followers • user_timeline • featured • show • show • update Direct Message Methods: • replies • direct_messages • destroy • sent Account Methods: • new • verify_credentials • destroy • end_session Friendship Methods: • archive • create • update_location • destroy • update_delivery_device • exists This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License 5
  • 6. The Twitter API: Continued Favorite Methods: Notification Methods: • favorites • follow • create • leave • destroy Block Methods Help Methods: • create • destroy • test • downtime_schedule This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License 6
  • 7. ReTweeter Use the Twitter API to fake “group” functions Create a new “group” account Follow back folks who follow that account When those users tweet with a hashtag, repost that tweet so that all followers see it, prefaced with the username of the original poster Could have sent direct messages instead Hashtag could be the name of the account but doesn't have to be This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License 7
  • 8. ReTweeter Basic Flow of Code Whole thing runs on a cron job • Rate limiting – 70 requests in 60 minutes • Unlimited posting Get friends_timeline.xml Returns the 20 most recent statuses posted in the last 24 hours from the authenticating user and that user's friends. curl -u email:password http://twitter.com/statuses/friends_timeline.xml Loop through posts in friends_timeline • Remove the group account itself (avoid loop!!) • Find all tweets in timeline beginning with hashtag • Put in database, with datestamp and id Pull all “un-retweeted” tweets from database Post those tweets, updating “retweeted” status as they post This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License 8
  • 9. ReTweeter Code Time allowing, we'll look at the code Otherwise you can get it later: http://www.openparenthesis.org/code/twitter-api Open Source, GPLv3 license Uses: • PHP 5 (SimpleXMLElement rocks) • MySQL DB • cron or equivalent (scheduled command line invocation) • cURL This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License 9
  • 10. Lessons Learned Don't Test on the Live Account • Bad developer spams his followers • If they use SMS, this can have an actual financial cost in addition to annoyance • Thankfully people are forgiving, generally Use a desktop client like Twhirl • Multiple client support • Talk amongst yourselves Twitter will go down • Not if, but when • Handle errors gracefully Twitter can enable “auto-follow-back” for you • Sometimes following people fails for undetermined reasons • Since the group account can't follow them back they can't post! This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License 10
  • 11. Q&A eckman.john@gmail.com jeckman@optaros.com http://twitter.com/jeckman http://johneckman.com/ (lifestream, profile links) http://www.openparenthesis.org/ (open source, web development, social applications) http://www.goatless.org/ (travel, veganism, music) http://www.optaros.com/user/jeckman (enterprise focus, how changes in the online industry affect Optaros clients and prospects) This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License 11