SlideShare uma empresa Scribd logo
1 de 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)

•

Mais conteúdo relacionado

Semelhante a Botを作ってみました

Twitter Start Guide : 초보자를 위한 트위터 완전정복 가이드
Twitter Start Guide : 초보자를 위한 트위터 완전정복 가이드 Twitter Start Guide : 초보자를 위한 트위터 완전정복 가이드
Twitter Start Guide : 초보자를 위한 트위터 완전정복 가이드 Jinho Jung
 
Twitter start guide for brandream
Twitter start guide for brandreamTwitter start guide for brandream
Twitter start guide for brandreamHome
 
ブロックチェーン概要のご紹介 #wakate2017
ブロックチェーン概要のご紹介 #wakate2017ブロックチェーン概要のご紹介 #wakate2017
ブロックチェーン概要のご紹介 #wakate2017whywaita
 
高専カンファ In 大阪
高専カンファ In 大阪高専カンファ In 大阪
高専カンファ In 大阪野村 弘樹
 
Jetpack Secrets - WordCamp Europe 2017
Jetpack Secrets - WordCamp Europe 2017Jetpack Secrets - WordCamp Europe 2017
Jetpack Secrets - WordCamp Europe 2017Richard Archambault
 
Medir講座Twitter(ツイッター)入門 ―その面白さと社会運動における可能性
Medir講座Twitter(ツイッター)入門 ―その面白さと社会運動における可能性Medir講座Twitter(ツイッター)入門 ―その面白さと社会運動における可能性
Medir講座Twitter(ツイッター)入門 ―その面白さと社会運動における可能性印鑰 智哉 INYAKU Tomoya
 
tumblr用クライアントアプリケーションの開発 @ KLabインターン成果発表
tumblr用クライアントアプリケーションの開発 @ KLabインターン成果発表 tumblr用クライアントアプリケーションの開発 @ KLabインターン成果発表
tumblr用クライアントアプリケーションの開発 @ KLabインターン成果発表 Kentaro Iizuka
 
ぼくとわたしのVim
ぼくとわたしのVimぼくとわたしのVim
ぼくとわたしのVimShota Fukumori
 
普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方
普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方
普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方Atsushi Harada
 
Bitcoin Community Forum India
Bitcoin Community Forum IndiaBitcoin Community Forum India
Bitcoin Community Forum IndiaBTC Warriors
 
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 InsightMatthew Russell
 
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 insightDigital Reasoning
 
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 HopAndrew Morris
 
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 factsRichard Archambault
 

Semelhante a 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
 

Último

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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.pdfsudhanshuwaghmare1
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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...Enterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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 Servicegiselly40
 
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...Miguel Araújo
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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 Scriptwesley chun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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 Nanonetsnaman860154
 
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...Martijn de Jong
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Último (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
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...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
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...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

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) •

Notas do Editor

  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