Your SlideShare is downloading. ×
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Hacking Twitter API [ Giran Siege ]

1,094

Published on

Apresentação para Giran Siege (http://www.slideshare.net/group/giran) sobre utilização da Twitter API

Apresentação para Giran Siege (http://www.slideshare.net/group/giran) sobre utilização da Twitter API

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,094
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Hacking the API Léo Hackin @leohackin leohackin.com.br :D
  • 2. TWITTER ?!
  • 3. TWITTER EM NÚMEROS•1 semana = um BILHÃO de tweets• 140 milhões de tweets por dia• 460k novas contas por dia• Aumento de 182% de acessos via mobile desde 2010• Em 2010, já tinhamos 75kk de usuários
  • 4. http://4.bp.blogspot.com/_FPSJMwYW4dY/TS27LwrpVDI/AAAAAAAAC5U/Ps6DW_Hg-iM/s1600/festival-de-verao-salvador.jpg trendtopics! @tagliati :D
  • 5. PORQUE USAR O TWITTER?• Facilidade imensa de uso• Nichos de informação• Capacidade de propagação de informação MUITO alta• Humanização da comunicação Empresa <=> Cliente• Forma natural e simples de indexação (#hashtags)• Capacidade de construção de aplicativos (API! :D)
  • 6. TWITTER API :) http://dev.twitter.com/
  • 7. API adequada! :) http://4.bp.blogspot.com/_Cb7SBOm3d4M/TS9O9-hPM4I/AAAAAAAAC2o/J7TAONOavJw/s1600/suzhou-buddha.jpg
  • 8. Fácilhttp://kerryhishon.files.wordpress.com/2010/10/learning-to-purl.jpg
  • 9. PoderosA •PHP •Ruby •C# •Java •Python •Javascript •... via Ábaco •Rest :Dhttp://wallpapers-diq.org/wallpapers/72/Arnold_Schwarzenegger%2C_IFBB_Mr._Olympia.jpg
  • 10. Flexivel :) •Tweets •Mentions •Direct Messages •Geolocation •Followers/Following •Lists •Everything!!!!!http://fc09.deviantart.net/fs26/f/2008/183/2/1/Flexibility_by_alice_lupa.jpg
  • 11. E gente a rodo usando! :Dhttp://blogs.estadao.com.br/filosofia-de-bem-viver/wp-content/blogs.dir/128/files/Happiness.jpg
  • 12. API CONSOLE
  • 13. REGISTRAR APP
  • 14. APPLICATION TYPEClient Browser
  • 15. REGISTRAR APP• Permite acessar recursos protegidos (via OAuth)• Número limitado de requests por hora (variável)• Permite cadastro de URL de callback (browser app)
  • 16. http://www.xboxkinecthacks.com/wp-content/uploads/2011/03/kid-hack.jpgHacking
  • 17. TWITTER GEM (RUBY) http://twitter.rubyforge.org/$ gem install twitter
  • 18. RECUPERANDO STATUS# Status mais recenteputs Twitter.user_timeline("giran_br").first.text# Procurando status com a hashtag #giranputs search.hashtag("#giran").no_retweets.per_page(1).fetch.first.text
  • 19. AUTENTICANDOTwitter.configure do |config| config.consumer_key = YOUR_CONSUMER_KEY config.consumer_secret = YOUR_CONSUMER_SECRET config.oauth_token = YOUR_OAUTH_TOKEN config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRETend# Inicializa cliente autenticadoclient = Twitter::Client.new
  • 20. POSTANDO NOVO STATUS# Post a status updateclient.update("@wbotelhos sends data")
  • 21. @ANYWHERE (JAVASCRIPT) http://platform.twitter.com/js-api.html API mantida oficialmente pelo Twitter
  • 22. RECUPERANDO STATUS<script src="http://platform.twitter.com/anywhere.js?id=API_KEY&v=chirp_preview"></script><script> twttr.anywhere(function(T) { // últimos 20 status do usuário @giran_br T.User.find(giran_br).timeline().first(20).each(function(status) { $(div#tweets).append(<p> + status.screenName + : + status.text + </p>); }); });</script>
  • 23. CRIANDO HOVERCARDS<script src="http://platform.twitter.com/anywhere.js?id=API_KEY&v=chirp_preview"></script><script type="text/javascript"> twttr.anywhere(onAnywhereLoad); function onAnywhereLoad(twitter) { twitter.linkifyUsers(); };</script>
  • 24. TWEET BOX<script src="http://platform.twitter.com/anywhere.js?id=API_KEY&v=chirp_preview"></script>twitter(".comments").tweetBox({ label: What do you think about this article?, defaultContent: #nettuts , onTweet: function(plain, html){ // Actions when tweet is sent }});

×