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

Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...FIDO Alliance
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfdanishmna97
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 

Recently uploaded (20)

Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 

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