• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Hacking Twitter API [ Giran Siege ]
 

Hacking Twitter API [ Giran Siege ]

on

  • 1,285 views

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

Statistics

Views

Total Views
1,285
Views on SlideShare
1,285
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Hacking Twitter API [ Giran Siege ] Hacking Twitter API [ Giran Siege ] Presentation Transcript

    • Hacking the API Léo Hackin @leohackin leohackin.com.br :D
    • TWITTER ?!
    • 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
    • http://4.bp.blogspot.com/_FPSJMwYW4dY/TS27LwrpVDI/AAAAAAAAC5U/Ps6DW_Hg-iM/s1600/festival-de-verao-salvador.jpg trendtopics! @tagliati :D
    • 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)
    • TWITTER API :) http://dev.twitter.com/
    • API adequada! :) http://4.bp.blogspot.com/_Cb7SBOm3d4M/TS9O9-hPM4I/AAAAAAAAC2o/J7TAONOavJw/s1600/suzhou-buddha.jpg
    • Fácilhttp://kerryhishon.files.wordpress.com/2010/10/learning-to-purl.jpg
    • PoderosA •PHP •Ruby •C# •Java •Python •Javascript •... via Ábaco •Rest :Dhttp://wallpapers-diq.org/wallpapers/72/Arnold_Schwarzenegger%2C_IFBB_Mr._Olympia.jpg
    • 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
    • E gente a rodo usando! :Dhttp://blogs.estadao.com.br/filosofia-de-bem-viver/wp-content/blogs.dir/128/files/Happiness.jpg
    • API CONSOLE
    • REGISTRAR APP
    • APPLICATION TYPEClient Browser
    • 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)
    • http://www.xboxkinecthacks.com/wp-content/uploads/2011/03/kid-hack.jpgHacking
    • TWITTER GEM (RUBY) http://twitter.rubyforge.org/$ gem install twitter
    • 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
    • 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
    • POSTANDO NOVO STATUS# Post a status updateclient.update("@wbotelhos sends data")
    • @ANYWHERE (JAVASCRIPT) http://platform.twitter.com/js-api.html API mantida oficialmente pelo Twitter
    • 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>
    • 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>
    • 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 }});