SlideShare uma empresa Scribd logo
1 de 9
Using                ’s API with PHP



    Katherine Lee | Internet Applications
beta

Concept: using Twitter’s API and a PHP site to
  retrieve and store mobile location and message in a
  database

                                On my way to the
                                library, where my
                                wildest dreams are
                                going to come true
                                today
• OAuth is an authentication protocol through which a
  user may allow an application to perform some
  action on their behalf without sharing their password
• The important thing is that it’s a standardized way of
  granting secure API access to user accounts
cURL: How the API
                    communicates with PHP
 function http($url, $post_data = null) {/*{{{*/
   $ch = curl_init();
   if (defined(quot;CURL_CA_BUNDLE_PATHquot;)) curl_setopt($ch, CURLOPT_CAINFO, CURL_CA_BUNDLE_PATH);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
   //////////////////////////////////////////////////
   ///// Set to 1 to verify Twitter's SSL Cert //////
   //////////////////////////////////////////////////
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
   if (isset($post_data)) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
   }
   $response = curl_exec($ch);
   $this->http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
   $this->last_api_call = $url;
curl_close ($ch);
   return $response;
How Twitter OAuth works
• You register your application with Twitter, specifying a callback URL
• Twitter gives you:
    1.   Consumer key
    2.   Consumer secret
    3.   Request token URL
    4.   Access token URL
    5.   Authorize URL
•    Consumer key+secret initiate a conversation with Twitter
•    If the key+secret are validated by Twitter, Twitter’s request token
     allows you to send the user to an authorize URL
•    If the user grants your application permission, Twitter sends the
     user to your callback URL
Info I can pull on the User
• Full name
• Twitter username
• Location (longitude/latitude only for GPS or iPhone
  enabled devices)
• Photo icon
• Date joined Twitter network
• Date/Time/Message in last tweet

                    Locovore demo
Issues
• Lack of standardization in mobile location capability in
  devices
• Twitterific (and apps like it) are only for iPhone or GPS-
  supporting devices
• Google Latitude only supported by:
   –   Android-powered devices
   –   Most color Blackberry devices
   –   Most Windows Mobile 5.0+ devices
   –   Most Symbian S60 devices
• Too bad if you don’t have GPS – your Google MyLocation
  will be inaccurate and is only supported on some Motorola
  and Sony Erickson devices outside of those devices
  supported by Google Latitude
Future
• Better, more universal location standards for
  mobile use
• See only local tweets within a very small
  radius of wherever you happen to be
Thanks
Code based on William Abraham’s:
• Fire Eagle code -
  http://github.com/myelin/fireeagle-php-lib
• twitterlibphp -
  http://github.com/poseurtech/twitterlibphp

Mais conteúdo relacionado

Destaque

Thesis091009
Thesis091009Thesis091009
Thesis091009klee4vp
 
autozone CodeofConductFY2008_English
autozone  CodeofConductFY2008_Englishautozone  CodeofConductFY2008_English
autozone CodeofConductFY2008_Englishfinance46
 
molson coors brewing COORS_AR2000
molson coors brewing  COORS_AR2000molson coors brewing  COORS_AR2000
molson coors brewing COORS_AR2000finance46
 
Make everything realtime & collaborative - JS Summit 2014
Make everything realtime & collaborative - JS Summit 2014Make everything realtime & collaborative - JS Summit 2014
Make everything realtime & collaborative - JS Summit 2014Joseph Gentle
 
MOLSONCOORS_AR2004_EN
MOLSONCOORS_AR2004_ENMOLSONCOORS_AR2004_EN
MOLSONCOORS_AR2004_ENfinance46
 
Crowdfunding 7.27.13
Crowdfunding 7.27.13Crowdfunding 7.27.13
Crowdfunding 7.27.13ArtSpark
 
Creating a good architecture
Creating a good architectureCreating a good architecture
Creating a good architectureFrank Sons
 
Презентация УТГ 2009
Презентация УТГ 2009Презентация УТГ 2009
Презентация УТГ 2009Vadim Andreev
 
Kwyjibos
KwyjibosKwyjibos
Kwyjibosklee4vp
 
omnicare annual reports 1998
omnicare annual reports 1998omnicare annual reports 1998
omnicare annual reports 1998finance46
 
Building A Goal Aligned Enterprise Public
Building A Goal Aligned Enterprise   PublicBuilding A Goal Aligned Enterprise   Public
Building A Goal Aligned Enterprise Publicgregflay
 
Taking PHP to the next level
Taking PHP to the next levelTaking PHP to the next level
Taking PHP to the next levelDavid Coallier
 
Thesis Midterm032610
Thesis Midterm032610Thesis Midterm032610
Thesis Midterm032610klee4vp
 

Destaque (18)

1:World@Haverford
1:World@Haverford1:World@Haverford
1:World@Haverford
 
Thesis091009
Thesis091009Thesis091009
Thesis091009
 
Oof Epowerpoint
Oof EpowerpointOof Epowerpoint
Oof Epowerpoint
 
O azul
O azulO azul
O azul
 
Sears L
Sears LSears L
Sears L
 
autozone CodeofConductFY2008_English
autozone  CodeofConductFY2008_Englishautozone  CodeofConductFY2008_English
autozone CodeofConductFY2008_English
 
molson coors brewing COORS_AR2000
molson coors brewing  COORS_AR2000molson coors brewing  COORS_AR2000
molson coors brewing COORS_AR2000
 
Make everything realtime & collaborative - JS Summit 2014
Make everything realtime & collaborative - JS Summit 2014Make everything realtime & collaborative - JS Summit 2014
Make everything realtime & collaborative - JS Summit 2014
 
MOLSONCOORS_AR2004_EN
MOLSONCOORS_AR2004_ENMOLSONCOORS_AR2004_EN
MOLSONCOORS_AR2004_EN
 
Crowdfunding 7.27.13
Crowdfunding 7.27.13Crowdfunding 7.27.13
Crowdfunding 7.27.13
 
Creating a good architecture
Creating a good architectureCreating a good architecture
Creating a good architecture
 
Презентация УТГ 2009
Презентация УТГ 2009Презентация УТГ 2009
Презентация УТГ 2009
 
The Americas 2
The Americas 2The Americas 2
The Americas 2
 
Kwyjibos
KwyjibosKwyjibos
Kwyjibos
 
omnicare annual reports 1998
omnicare annual reports 1998omnicare annual reports 1998
omnicare annual reports 1998
 
Building A Goal Aligned Enterprise Public
Building A Goal Aligned Enterprise   PublicBuilding A Goal Aligned Enterprise   Public
Building A Goal Aligned Enterprise Public
 
Taking PHP to the next level
Taking PHP to the next levelTaking PHP to the next level
Taking PHP to the next level
 
Thesis Midterm032610
Thesis Midterm032610Thesis Midterm032610
Thesis Midterm032610
 

Semelhante a Locovore

Fire Eagle presentation for IIT Delhi Hack U event
Fire Eagle presentation for IIT Delhi Hack U eventFire Eagle presentation for IIT Delhi Hack U event
Fire Eagle presentation for IIT Delhi Hack U eventarnab.nandi
 
OAuth Introduction
OAuth IntroductionOAuth Introduction
OAuth Introductionh_marvin
 
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...Brian Campbell
 
PyConWeb - 2019 Auditing websites & apps for privacy leaks.
PyConWeb - 2019 Auditing websites & apps for privacy leaks.PyConWeb - 2019 Auditing websites & apps for privacy leaks.
PyConWeb - 2019 Auditing websites & apps for privacy leaks.Konark modi
 
Securing RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID ConnectSecuring RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID ConnectJonathan LeBlanc
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Luc Bors
 
Internet of things the salesforce lego machine cloud
Internet of things   the salesforce lego machine cloudInternet of things   the salesforce lego machine cloud
Internet of things the salesforce lego machine cloudandyinthecloud
 
Zotero Visualisierungen
Zotero VisualisierungenZotero Visualisierungen
Zotero Visualisierungenadrianwilke
 
HTTP 프로토콜의 이해와 활용
HTTP 프로토콜의 이해와 활용HTTP 프로토콜의 이해와 활용
HTTP 프로토콜의 이해와 활용SangJin Kang
 
Goodle Developer Days Munich 2008 - Open Social Update
Goodle Developer Days Munich 2008 - Open Social UpdateGoodle Developer Days Munich 2008 - Open Social Update
Goodle Developer Days Munich 2008 - Open Social UpdatePatrick Chanezon
 
BarCamp KL H20 Open Social Hackathon
BarCamp KL H20 Open Social HackathonBarCamp KL H20 Open Social Hackathon
BarCamp KL H20 Open Social Hackathonmarvin337
 
Cloud Foundry API for Fun and Ops
Cloud Foundry API for Fun and OpsCloud Foundry API for Fun and Ops
Cloud Foundry API for Fun and OpsChris DeLashmutt
 
Windows Phone 8 - 13 Near Field Communcations and Bluetooth
Windows Phone 8 - 13 Near Field Communcations and BluetoothWindows Phone 8 - 13 Near Field Communcations and Bluetooth
Windows Phone 8 - 13 Near Field Communcations and BluetoothOliver Scheer
 
Firesheep & HTTPS, Explained!
Firesheep & HTTPS, Explained!Firesheep & HTTPS, Explained!
Firesheep & HTTPS, Explained!Mahmoud Tantawy
 
An Introduction to OAuth 2
An Introduction to OAuth 2An Introduction to OAuth 2
An Introduction to OAuth 2Aaron Parecki
 

Semelhante a Locovore (20)

Fire Eagle presentation for IIT Delhi Hack U event
Fire Eagle presentation for IIT Delhi Hack U eventFire Eagle presentation for IIT Delhi Hack U event
Fire Eagle presentation for IIT Delhi Hack U event
 
Yahoo! Geo Technologies-IITD
Yahoo! Geo Technologies-IITDYahoo! Geo Technologies-IITD
Yahoo! Geo Technologies-IITD
 
OAuth Introduction
OAuth IntroductionOAuth Introduction
OAuth Introduction
 
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
 
PyConWeb - 2019 Auditing websites & apps for privacy leaks.
PyConWeb - 2019 Auditing websites & apps for privacy leaks.PyConWeb - 2019 Auditing websites & apps for privacy leaks.
PyConWeb - 2019 Auditing websites & apps for privacy leaks.
 
Securing RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID ConnectSecuring RESTful APIs using OAuth 2 and OpenID Connect
Securing RESTful APIs using OAuth 2 and OpenID Connect
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)
 
Swift meetup22june2015
Swift meetup22june2015Swift meetup22june2015
Swift meetup22june2015
 
Internet of things the salesforce lego machine cloud
Internet of things   the salesforce lego machine cloudInternet of things   the salesforce lego machine cloud
Internet of things the salesforce lego machine cloud
 
Zotero Visualisierungen
Zotero VisualisierungenZotero Visualisierungen
Zotero Visualisierungen
 
HTTP 프로토콜의 이해와 활용
HTTP 프로토콜의 이해와 활용HTTP 프로토콜의 이해와 활용
HTTP 프로토콜의 이해와 활용
 
MyATM
MyATMMyATM
MyATM
 
Goodle Developer Days Munich 2008 - Open Social Update
Goodle Developer Days Munich 2008 - Open Social UpdateGoodle Developer Days Munich 2008 - Open Social Update
Goodle Developer Days Munich 2008 - Open Social Update
 
BarCamp KL H20 Open Social Hackathon
BarCamp KL H20 Open Social HackathonBarCamp KL H20 Open Social Hackathon
BarCamp KL H20 Open Social Hackathon
 
Cloud Foundry API for Fun and Ops
Cloud Foundry API for Fun and OpsCloud Foundry API for Fun and Ops
Cloud Foundry API for Fun and Ops
 
Windows Phone 8 - 13 Near Field Communcations and Bluetooth
Windows Phone 8 - 13 Near Field Communcations and BluetoothWindows Phone 8 - 13 Near Field Communcations and Bluetooth
Windows Phone 8 - 13 Near Field Communcations and Bluetooth
 
Firesheep & HTTPS, Explained!
Firesheep & HTTPS, Explained!Firesheep & HTTPS, Explained!
Firesheep & HTTPS, Explained!
 
HTTP Basics Demo
HTTP Basics DemoHTTP Basics Demo
HTTP Basics Demo
 
What's happening here?
What's happening here?What's happening here?
What's happening here?
 
An Introduction to OAuth 2
An Introduction to OAuth 2An Introduction to OAuth 2
An Introduction to OAuth 2
 

Mais de klee4vp

Mobile clinic breast_cancer_research_proposal_
Mobile clinic breast_cancer_research_proposal_Mobile clinic breast_cancer_research_proposal_
Mobile clinic breast_cancer_research_proposal_klee4vp
 
Mobile clinic breast_cancer_research_proposal_
Mobile clinic breast_cancer_research_proposal_Mobile clinic breast_cancer_research_proposal_
Mobile clinic breast_cancer_research_proposal_klee4vp
 
Mock thesisfinal042710
Mock thesisfinal042710Mock thesisfinal042710
Mock thesisfinal042710klee4vp
 
Crystallized042210
Crystallized042210Crystallized042210
Crystallized042210klee4vp
 
Crystallized040910
Crystallized040910Crystallized040910
Crystallized040910klee4vp
 
Breast Cancer040710
Breast Cancer040710Breast Cancer040710
Breast Cancer040710klee4vp
 
Nano Bio Art040201
Nano Bio Art040201Nano Bio Art040201
Nano Bio Art040201klee4vp
 
Thesis Midterm032610
Thesis Midterm032610Thesis Midterm032610
Thesis Midterm032610klee4vp
 
Thesis Midterm032610
Thesis Midterm032610Thesis Midterm032610
Thesis Midterm032610klee4vp
 
Thesis Midterm030910
Thesis Midterm030910Thesis Midterm030910
Thesis Midterm030910klee4vp
 
Breast Cancer030310
Breast Cancer030310Breast Cancer030310
Breast Cancer030310klee4vp
 
Thesis012910
Thesis012910Thesis012910
Thesis012910klee4vp
 
Thesis Brief012510
Thesis Brief012510Thesis Brief012510
Thesis Brief012510klee4vp
 
Thesis Final120809
Thesis Final120809Thesis Final120809
Thesis Final120809klee4vp
 
Thesis Final120309
Thesis Final120309Thesis Final120309
Thesis Final120309klee4vp
 
Thesis Final120309
Thesis Final120309Thesis Final120309
Thesis Final120309klee4vp
 
Thesis Update111909
Thesis Update111909Thesis Update111909
Thesis Update111909klee4vp
 
Peer Review - MFADT thesis
Peer Review - MFADT thesisPeer Review - MFADT thesis
Peer Review - MFADT thesisklee4vp
 
Thesis110309
Thesis110309Thesis110309
Thesis110309klee4vp
 
Thesismidterm101309
Thesismidterm101309Thesismidterm101309
Thesismidterm101309klee4vp
 

Mais de klee4vp (20)

Mobile clinic breast_cancer_research_proposal_
Mobile clinic breast_cancer_research_proposal_Mobile clinic breast_cancer_research_proposal_
Mobile clinic breast_cancer_research_proposal_
 
Mobile clinic breast_cancer_research_proposal_
Mobile clinic breast_cancer_research_proposal_Mobile clinic breast_cancer_research_proposal_
Mobile clinic breast_cancer_research_proposal_
 
Mock thesisfinal042710
Mock thesisfinal042710Mock thesisfinal042710
Mock thesisfinal042710
 
Crystallized042210
Crystallized042210Crystallized042210
Crystallized042210
 
Crystallized040910
Crystallized040910Crystallized040910
Crystallized040910
 
Breast Cancer040710
Breast Cancer040710Breast Cancer040710
Breast Cancer040710
 
Nano Bio Art040201
Nano Bio Art040201Nano Bio Art040201
Nano Bio Art040201
 
Thesis Midterm032610
Thesis Midterm032610Thesis Midterm032610
Thesis Midterm032610
 
Thesis Midterm032610
Thesis Midterm032610Thesis Midterm032610
Thesis Midterm032610
 
Thesis Midterm030910
Thesis Midterm030910Thesis Midterm030910
Thesis Midterm030910
 
Breast Cancer030310
Breast Cancer030310Breast Cancer030310
Breast Cancer030310
 
Thesis012910
Thesis012910Thesis012910
Thesis012910
 
Thesis Brief012510
Thesis Brief012510Thesis Brief012510
Thesis Brief012510
 
Thesis Final120809
Thesis Final120809Thesis Final120809
Thesis Final120809
 
Thesis Final120309
Thesis Final120309Thesis Final120309
Thesis Final120309
 
Thesis Final120309
Thesis Final120309Thesis Final120309
Thesis Final120309
 
Thesis Update111909
Thesis Update111909Thesis Update111909
Thesis Update111909
 
Peer Review - MFADT thesis
Peer Review - MFADT thesisPeer Review - MFADT thesis
Peer Review - MFADT thesis
 
Thesis110309
Thesis110309Thesis110309
Thesis110309
 
Thesismidterm101309
Thesismidterm101309Thesismidterm101309
Thesismidterm101309
 

Último

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Último (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Locovore

  • 1. Using ’s API with PHP Katherine Lee | Internet Applications
  • 2. beta Concept: using Twitter’s API and a PHP site to retrieve and store mobile location and message in a database On my way to the library, where my wildest dreams are going to come true today
  • 3. • OAuth is an authentication protocol through which a user may allow an application to perform some action on their behalf without sharing their password • The important thing is that it’s a standardized way of granting secure API access to user accounts
  • 4. cURL: How the API communicates with PHP function http($url, $post_data = null) {/*{{{*/ $ch = curl_init(); if (defined(quot;CURL_CA_BUNDLE_PATHquot;)) curl_setopt($ch, CURLOPT_CAINFO, CURL_CA_BUNDLE_PATH); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); ////////////////////////////////////////////////// ///// Set to 1 to verify Twitter's SSL Cert ////// ////////////////////////////////////////////////// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); if (isset($post_data)) { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); } $response = curl_exec($ch); $this->http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE); $this->last_api_call = $url; curl_close ($ch); return $response;
  • 5. How Twitter OAuth works • You register your application with Twitter, specifying a callback URL • Twitter gives you: 1. Consumer key 2. Consumer secret 3. Request token URL 4. Access token URL 5. Authorize URL • Consumer key+secret initiate a conversation with Twitter • If the key+secret are validated by Twitter, Twitter’s request token allows you to send the user to an authorize URL • If the user grants your application permission, Twitter sends the user to your callback URL
  • 6. Info I can pull on the User • Full name • Twitter username • Location (longitude/latitude only for GPS or iPhone enabled devices) • Photo icon • Date joined Twitter network • Date/Time/Message in last tweet Locovore demo
  • 7. Issues • Lack of standardization in mobile location capability in devices • Twitterific (and apps like it) are only for iPhone or GPS- supporting devices • Google Latitude only supported by: – Android-powered devices – Most color Blackberry devices – Most Windows Mobile 5.0+ devices – Most Symbian S60 devices • Too bad if you don’t have GPS – your Google MyLocation will be inaccurate and is only supported on some Motorola and Sony Erickson devices outside of those devices supported by Google Latitude
  • 8. Future • Better, more universal location standards for mobile use • See only local tweets within a very small radius of wherever you happen to be
  • 9. Thanks Code based on William Abraham’s: • Fire Eagle code - http://github.com/myelin/fireeagle-php-lib • twitterlibphp - http://github.com/poseurtech/twitterlibphp