SlideShare ist ein Scribd-Unternehmen logo
1 von 15
bot
      Ruby twitter_oauth



                      Akita.m


                                2011.1.19
@slope_akita
 •



     @gutskun
http://d.hatena.ne.jp/gutskun/20101230/1293677137


   • bot
   • PIN
   • bot
bot
•         twitter

•
    • gmail
     • foo + bar @gmail.com (   1)

     •
                (    2)
•           @gutskun



•   >   >         (    )
•
• Read & Write
• Consumer key
• Consumer secret
PIN
  • make_token.rb (mirakui                      )
      https://gist.github.com/388067
     • oauth_token
luke:bot ISD$ ruby make_token.rb
Consumer Key> sUYsI7yoP99U4egGGNnYtA
Consumer Secret> EKXLYibot6PBy5IrLBfEaMmHbyxn5L3H6DZxmDpdM
OK
please access and get PIN: http://api.twitter.com/oauth/authorize?
oauth_token=c8NX52UtRj9z5KU7M5Dx5Av149A7U3aPV1v0ePjU0
• bot
• url
• PIN
• Access Token
 • Access Secret

PIN> 2110088
Authorized: true
Access Token: 231715650-q5jtdKlpxWT2cEk7VFgi2H40jdxEniaMCX3z6Eta
Access Secret: E3jZlem4PlhsacJULpCCK99TlaIOuFixKix81Nyp5SI
twitter_oauth
•
• update
  •
def twitter
  TwitterOAuth::Client.new({
     :consumer_key => @config['twitter']['consumer_key'],
     :consumer_secret => @config['twitter']['consumer_secret'],
     :token => @config['twitter']['token'],
     :secret => @config['twitter']['secret']
  })
end

@twitter = twitter
@twitter.update(‘Hello, world’)
•


•
•
•
•
    (Ruby)

•

Weitere ähnliche Inhalte

Ähnlich wie Botを作ってみました

Ähnlich wie Botを作ってみました (17)

Twitter Start Guide : 초보자를 위한 트위터 완전정복 가이드
Twitter Start Guide : 초보자를 위한 트위터 완전정복 가이드 Twitter Start Guide : 초보자를 위한 트위터 완전정복 가이드
Twitter Start Guide : 초보자를 위한 트위터 완전정복 가이드
 
Twitter start guide for brandream
Twitter start guide for brandreamTwitter start guide for brandream
Twitter start guide for brandream
 
ブロックチェーン概要のご紹介 #wakate2017
ブロックチェーン概要のご紹介 #wakate2017ブロックチェーン概要のご紹介 #wakate2017
ブロックチェーン概要のご紹介 #wakate2017
 
Onsg10 Intro Termtter
Onsg10 Intro TermtterOnsg10 Intro Termtter
Onsg10 Intro Termtter
 
高専カンファ In 大阪
高専カンファ In 大阪高専カンファ In 大阪
高専カンファ In 大阪
 
Jetpack Secrets - WordCamp Europe 2017
Jetpack Secrets - WordCamp Europe 2017Jetpack Secrets - WordCamp Europe 2017
Jetpack Secrets - WordCamp Europe 2017
 
Medir講座Twitter(ツイッター)入門 ―その面白さと社会運動における可能性
Medir講座Twitter(ツイッター)入門 ―その面白さと社会運動における可能性Medir講座Twitter(ツイッター)入門 ―その面白さと社会運動における可能性
Medir講座Twitter(ツイッター)入門 ―その面白さと社会運動における可能性
 
tumblr用クライアントアプリケーションの開発 @ KLabインターン成果発表
tumblr用クライアントアプリケーションの開発 @ KLabインターン成果発表 tumblr用クライアントアプリケーションの開発 @ KLabインターン成果発表
tumblr用クライアントアプリケーションの開発 @ KLabインターン成果発表
 
Lightning networkの解説
Lightning networkの解説Lightning networkの解説
Lightning networkの解説
 
ぼくとわたしのVim
ぼくとわたしのVimぼくとわたしのVim
ぼくとわたしのVim
 
2FA WTF
2FA WTF2FA WTF
2FA WTF
 
普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方
普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方
普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方
 
Bitcoin Community Forum India
Bitcoin Community Forum IndiaBitcoin Community Forum India
Bitcoin Community Forum India
 
Unleashing Twitter Data for Fun and Insight
Unleashing Twitter Data for Fun and InsightUnleashing Twitter Data for Fun and Insight
Unleashing Twitter Data for Fun and Insight
 
Unleashing twitter data for fun and insight
Unleashing twitter data for fun and insightUnleashing twitter data for fun and insight
Unleashing twitter data for fun and insight
 
Flaying the Blockchain Ledger for Fun, Profit, and Hip Hop
Flaying the Blockchain Ledger for Fun, Profit, and Hip HopFlaying the Blockchain Ledger for Fun, Profit, and Hip Hop
Flaying the Blockchain Ledger for Fun, Profit, and Hip Hop
 
Jetpack Secrets - Theme Tools, Actions and Filters, and other little known facts
Jetpack Secrets - Theme Tools, Actions and Filters, and other little known factsJetpack Secrets - Theme Tools, Actions and Filters, and other little known facts
Jetpack Secrets - Theme Tools, Actions and Filters, and other little known facts
 

Kürzlich hochgeladen

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
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

Botを作ってみました

  • 1. bot Ruby twitter_oauth Akita.m 2011.1.19
  • 2. @slope_akita • @gutskun
  • 3.
  • 5. bot • twitter • • gmail • foo + bar @gmail.com ( 1) • ( 2)
  • 6. @gutskun • > > ( )
  • 8. • Consumer key • Consumer secret
  • 9. PIN • make_token.rb (mirakui ) https://gist.github.com/388067 • oauth_token luke:bot ISD$ ruby make_token.rb Consumer Key> sUYsI7yoP99U4egGGNnYtA Consumer Secret> EKXLYibot6PBy5IrLBfEaMmHbyxn5L3H6DZxmDpdM OK please access and get PIN: http://api.twitter.com/oauth/authorize? oauth_token=c8NX52UtRj9z5KU7M5Dx5Av149A7U3aPV1v0ePjU0
  • 11. • Access Token • Access Secret PIN> 2110088 Authorized: true Access Token: 231715650-q5jtdKlpxWT2cEk7VFgi2H40jdxEniaMCX3z6Eta Access Secret: E3jZlem4PlhsacJULpCCK99TlaIOuFixKix81Nyp5SI
  • 12. twitter_oauth • • update • def twitter TwitterOAuth::Client.new({ :consumer_key => @config['twitter']['consumer_key'], :consumer_secret => @config['twitter']['consumer_secret'], :token => @config['twitter']['token'], :secret => @config['twitter']['secret'] }) end @twitter = twitter @twitter.update(‘Hello, world’)
  • 15. (Ruby) •

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n