SlideShare une entreprise Scribd logo
1  sur  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)

•

Contenu connexe

Similaire à 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
 

Similaire à 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
 

Dernier

🐬 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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
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
 
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 slidevu2urc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
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 FresherRemote DBA Services
 
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 2024The Digital Insurer
 

Dernier (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
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
 
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
 
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
 

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

Notes de l'éditeur

  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