SlideShare a Scribd company logo
1 of 77
Integrating @Anywhere


Todd Kloots
Frontend Engineer - Platform
Setup
3 Steps
Step 1
http://dev.twitter.com/anywhere/apps/new
Step 2
Paste!
<script src="http://platform.twitter.com/anywhere.js?id=API_KEY&v=1"></script>

<script type="text/javascript">

 twttr.anywhere(function(T) {

   T.hovercards();

 });

</script>
Step 3
(Just kidding.)
(No step 3.)
(You’re done!)
Goals
Goals
•   Easy

•   Fast

•   Self-contained
Easy
<script src="http://platform.twitter.com/anywhere.js?id=API_KEY&v=1"></script>

<script type="text/javascript">

 twttr.anywhere(function(T) {

   T.hovercards();

 });

</script>
/anywhere.js?id=API_KEY&v=1"></script>

<script type="text/javascript">

  twttr.anywhere(function(T) {

    T.hovercards();

  });

</script>
<script type="text/javascript">

  twttr.anywhere(function(T) {

    T.hovercards();

  });

</script>
<script type="text/javascript">

  twttr.anywhere(function(T) {

    T.hovercards();
    T("body").hovercards();

  });

</script>
<div id="main">
  ...
</div>

<script type="text/javascript">

  twttr.anywhere(function(T) {

    T("#main").hovercards();

  });

</script>
Fast
anywhere.js
•   Tiny (~2KB GZIP'd)

•   Single, blocking request

•   All dependencies loaded asynchronously

•   Features loaded on demand
<script src="http://platform.twitter.com/anywhere.js?id=API_KEY&v=1"></script>

<script type="text/javascript">

 twttr.anywhere(function(T) {

   T.hovercards();

 });

</script>

<div id="tbox"></div>
<script type="text/javascript">

 twttr.anywhere(function(T) {

   T("#tbox").tweetBox();

 });

</script>
<script type="text/javascript">

  twttr.anywhere(function(T) {

   T("#tbox").tweetBox();

   T.hovercards();

  });

</script>
<script type="text/javascript">

  twttr.anywhere(function(T) {

    $("#comment-btn").bind("click", function () {
      T("#tbox").tweetBox();
    });

  });

</script>
Self-Contained
<iframe>
Goals
•   Easy

•   Fast

•   Self-contained
Use Cases
Identity
<span id="login"></span>

<script type="text/javascript">

twttr.anywhere(function(T) {

  T("#login").connectButton({

      authComplete: function(user) {

          myApp.login(user);

      },
      signOut: function() {

          myApp.logout();

      }

  });

});

</script>
OAuth 2.0
•   Draft spec
    •   (http://github.com/daveman692/OAuth-2.0)


•   Using the client-only profile

•   OAuth 1.0 endpoint is recommend

•   Eventual migration plan to OAuth 2.0
jQuery(function () {

  twttr.anywhere(function (T) {

      if (T.isConnected()) {

          myApp.login(T.currentUser);

          $("#signout").bind("click", function () {
            twttr.anywhere.signOut();
          });

      }
      else {

          T("#login").connectButton();

      }

  });

});
YUI().use("node", function(Y) {

  Y.on("domready", function () {

        twttr.anywhere(function (T) {

          if (T.isConnected()) {

              myApp.login(T.currentUser);

              Y.one("#signout").on("click", function () {
                T.anywhere.signOut();
              });

          }
          else {

              T("#signin").connectButton();

          }

        });

  });

});
<span id="follow"></span>

<script type="text/javascript">

twttr.anywhere(function (T) {

  T.bind("authComplete", function (e, user) {

       myApp.login(T.currentUser);

  });

  T.bind("signOut", function (e) {

      myApp.logout();

  });

  T("#follow").followButton();

});

</script>
Tools
Linkify Users
@ded



@<a href="http://twitter.com/ded" class="twitter-anywhere-user">ded</a>
<script type="text/javascript">

twttr.anywhere(function (T) {

  T.linkifyUsers();

});

</script>
<script type="text/javascript">

twttr.anywhere(function (T) {

  T("#main").linkifyUsers({ className: "t-user" });

});

</script>
<script type="text/javascript">

twttr.anywhere(function (T) {

  T(selector).linkifyUsers(options);

});

</script>
http://dev.twitter.com/anywhere/begin
Follow Button
<span id="follow"></span>

<script type="text/javascript">

  twttr.anywhere(function(T) {

    T("#follow").followButton('ded');

  });

</script>
TweetBox
<div id="tbox"></div>

<script type="text/javascript">

  twttr.anywhere(function(T) {

    T("#tbox").tweetBox();

  });

</script>
Hovercards
Tools
•   Linkify Users

•   Follow Button

•   Hovercards

•   Tweetbox
API
http://platform.twitter.com/js-api.html

<script src=".../anywhere.js?id=API_KEY&v=chirp_preview"></script>
<script type="text/javascript">

 twttr.anywhere.config({
   assetHost: 'twitter-anywhere.s3.amazonaws.com'
 });

 twttr.anywhere(function(T) {

   // YOUR CODE HERE

 });

</script>
twttr.anywhere(function(T) {

  T.User.find('dsa', function (user) {

      console.log(user.profile_image_url);

  });

});
twttr.anywhere(function(T) {

  T.User.find('dsa', {
    success: function (user) {
       console.log(user.profile_image_url);
    },
    error: function () {
       // Handle error
    }
  });

});
twttr.anywhere(function(T) {

  T.User.find('dsa', function (user) {

      user.followers(function (users) {

        users.each(function (user) {

           console.log(user.name);

        });

      })

  });

});
twttr.anywhere(function(T) {

  T.User.find('dsa').followers().each(function (user) {

      console.log(user.screenName);

  });

});
http://platform.twitter.com/js-api.html
Versioning
/anywhere.js?id=API_KEY&v=1"></script>

<script type="text/javascript">

  twttr.anywhere(function(T) {

    T.hovercards();

  });

</script>
/anywhere.js?id=API_KEY&v=1.1"></script>

<script type="text/javascript">

  twttr.anywhere(function(T) {

    T.hovercards();

  });

</script>
/anywhere.js?id=API_KEY"></script>

<script type="text/javascript">

 twttr.anywhere("1", function(T) {

   T.hovercards();

 });

twttr.anywhere("1.4", function(T) {

   T.uberTweetBox();

 });

</script>
Window
Targeting
<script src="http://platform.twitter.com/anywhere?id=api_key&v=1"></script>

<div id="placeholder"></div>

<script type="text/javascript">

twttr.anywhere(function (T) {

  T("#placeholder").tweetBox();

});



var frameWin = document.getElementById("#iframe-1").contentWindow;

twttr({ window: frameWin }).anywhere(function (T) {

  T.hovercards();

});

</script>
Browser
Support
Browser Support
•   IE 6, 7, and 8

•   FF 3.x

•   Safari 4

•   Opera 10

•   Chrome 4
Support
@Anywhere Support
•   Docs

•   Forums

•   Bugs

•   @Anywhere, @ded, @dsa, @danwrong,
    @todd
http://dev.twitter.com/anywhere/begin
http://groups.google.com/group/twitter-dev-anywhere/
http://code.google.com/p/twitter-api/issues/list
The Road Ahead
• Widget customization
  •Styling
  •Events
• HTTPS
• Subdomain support
Q&A

More Related Content

What's hot

Chaincode Development 區塊鏈鏈碼開發
Chaincode Development 區塊鏈鏈碼開發Chaincode Development 區塊鏈鏈碼開發
Chaincode Development 區塊鏈鏈碼開發HO-HSUN LIN
 
Boosting Angular runtime performance
Boosting Angular runtime performanceBoosting Angular runtime performance
Boosting Angular runtime performanceNir Kaufman
 
An introduction to Angular2
An introduction to Angular2 An introduction to Angular2
An introduction to Angular2 Apptension
 
Testando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependênciasTestando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependênciasMarcelo Aymone
 
VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEDarwin Durand
 
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVER
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVERINSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVER
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVERDarwin Durand
 
Models, controllers and views
Models, controllers and viewsModels, controllers and views
Models, controllers and viewspriestc
 
Introduzione ad Autopilot
Introduzione ad AutopilotIntroduzione ad Autopilot
Introduzione ad AutopilotMarco Trevisan
 

What's hot (9)

Chaincode Development 區塊鏈鏈碼開發
Chaincode Development 區塊鏈鏈碼開發Chaincode Development 區塊鏈鏈碼開發
Chaincode Development 區塊鏈鏈碼開發
 
Boosting Angular runtime performance
Boosting Angular runtime performanceBoosting Angular runtime performance
Boosting Angular runtime performance
 
An introduction to Angular2
An introduction to Angular2 An introduction to Angular2
An introduction to Angular2
 
Testando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependênciasTestando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependências
 
VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLE
 
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVER
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVERINSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVER
INSERCION DE REGISTROS DESDE VISUAL.NET A UNA BD DE SQL SERVER
 
Models, controllers and views
Models, controllers and viewsModels, controllers and views
Models, controllers and views
 
Migrare da symfony 1 a Symfony2
 Migrare da symfony 1 a Symfony2  Migrare da symfony 1 a Symfony2
Migrare da symfony 1 a Symfony2
 
Introduzione ad Autopilot
Introduzione ad AutopilotIntroduzione ad Autopilot
Introduzione ad Autopilot
 

Viewers also liked

Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)ejlp12
 
Final Presentation
Final PresentationFinal Presentation
Final Presentationliangtfm
 
Digital Mediaina state
Digital Mediaina stateDigital Mediaina state
Digital Mediaina stateSales Hub Pro
 
C O M E N S E N Y A R L L E N G U A A X I N E S O S X I V Tallers
C O M  E N S E N Y A R  L L E N G U A  A  X I N E S O S  X I V  TallersC O M  E N S E N Y A R  L L E N G U A  A  X I N E S O S  X I V  Tallers
C O M E N S E N Y A R L L E N G U A A X I N E S O S X I V TallersArnau Cerdà
 
Live streamemre
Live streamemreLive streamemre
Live streamemreemreorcan
 
Anixter Green Initiative
Anixter Green InitiativeAnixter Green Initiative
Anixter Green Initiativerrakib
 
Social media presentation kutadgu
Social media presentation kutadguSocial media presentation kutadgu
Social media presentation kutadguAhter Kutadgu
 
Com Ensenyar Llengua A Xinesos Xiv Tallers
Com Ensenyar Llengua A Xinesos Xiv TallersCom Ensenyar Llengua A Xinesos Xiv Tallers
Com Ensenyar Llengua A Xinesos Xiv TallersArnau Cerdà
 
【佐賀大学】平成20年環境報告書
【佐賀大学】平成20年環境報告書【佐賀大学】平成20年環境報告書
【佐賀大学】平成20年環境報告書env49
 
Increasing Access to Safe Drinking Water - by Summer
Increasing Access to Safe Drinking Water - by SummerIncreasing Access to Safe Drinking Water - by Summer
Increasing Access to Safe Drinking Water - by SummerAmalia Giebitz
 
Three brave boys
Three brave boysThree brave boys
Three brave boysyinglingyy
 
Cooperation needs on Field Operational Tests
Cooperation needs on Field Operational TestsCooperation needs on Field Operational Tests
Cooperation needs on Field Operational TestseuroFOT
 

Viewers also liked (20)

Social Sharing
Social Sharing Social Sharing
Social Sharing
 
Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)
 
Javascript
JavascriptJavascript
Javascript
 
Final Presentation
Final PresentationFinal Presentation
Final Presentation
 
Digital Mediaina state
Digital Mediaina stateDigital Mediaina state
Digital Mediaina state
 
C O M E N S E N Y A R L L E N G U A A X I N E S O S X I V Tallers
C O M  E N S E N Y A R  L L E N G U A  A  X I N E S O S  X I V  TallersC O M  E N S E N Y A R  L L E N G U A  A  X I N E S O S  X I V  Tallers
C O M E N S E N Y A R L L E N G U A A X I N E S O S X I V Tallers
 
Live streamemre
Live streamemreLive streamemre
Live streamemre
 
Anixter Green Initiative
Anixter Green InitiativeAnixter Green Initiative
Anixter Green Initiative
 
S.M.A.R.T. фитнес Konev Sergey
S.M.A.R.T. фитнес Konev SergeyS.M.A.R.T. фитнес Konev Sergey
S.M.A.R.T. фитнес Konev Sergey
 
South Africa: A Nation in Denial?
South Africa: A Nation in Denial? South Africa: A Nation in Denial?
South Africa: A Nation in Denial?
 
Social media presentation kutadgu
Social media presentation kutadguSocial media presentation kutadgu
Social media presentation kutadgu
 
Pertussis en niños Lima
Pertussis en niños LimaPertussis en niños Lima
Pertussis en niños Lima
 
Karen Horsch Evaluating Change V.2
Karen Horsch   Evaluating Change V.2Karen Horsch   Evaluating Change V.2
Karen Horsch Evaluating Change V.2
 
Com Ensenyar Llengua A Xinesos Xiv Tallers
Com Ensenyar Llengua A Xinesos Xiv TallersCom Ensenyar Llengua A Xinesos Xiv Tallers
Com Ensenyar Llengua A Xinesos Xiv Tallers
 
Geotourismnov2008
Geotourismnov2008Geotourismnov2008
Geotourismnov2008
 
【佐賀大学】平成20年環境報告書
【佐賀大学】平成20年環境報告書【佐賀大学】平成20年環境報告書
【佐賀大学】平成20年環境報告書
 
Increasing Access to Safe Drinking Water - by Summer
Increasing Access to Safe Drinking Water - by SummerIncreasing Access to Safe Drinking Water - by Summer
Increasing Access to Safe Drinking Water - by Summer
 
Three brave boys
Three brave boysThree brave boys
Three brave boys
 
Cooperation needs on Field Operational Tests
Cooperation needs on Field Operational TestsCooperation needs on Field Operational Tests
Cooperation needs on Field Operational Tests
 
The Boomer Retirement Time Bomb
The Boomer Retirement Time BombThe Boomer Retirement Time Bomb
The Boomer Retirement Time Bomb
 

Similar to @Anywhere

Building @Anywhere (for TXJS)
Building @Anywhere (for TXJS)Building @Anywhere (for TXJS)
Building @Anywhere (for TXJS)danwrong
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Jeado Ko
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점 Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점 WebFrameworks
 
Net/http and the http.handler interface
Net/http and the http.handler interfaceNet/http and the http.handler interface
Net/http and the http.handler interfaceJoakim Gustin
 
Net/http and the http.handler interface
Net/http and the http.handler interfaceNet/http and the http.handler interface
Net/http and the http.handler interfaceEvolve
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMohammad Shaker
 
Getting Started with Real-Time Analytics
Getting Started with Real-Time AnalyticsGetting Started with Real-Time Analytics
Getting Started with Real-Time AnalyticsAmazon Web Services
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsFrancois Zaninotto
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup PerformanceJustin Cataldo
 
Android the Agile way
Android the Agile wayAndroid the Agile way
Android the Agile wayAshwin Raghav
 
Informatica_MDM_User_Exits.ppt
Informatica_MDM_User_Exits.pptInformatica_MDM_User_Exits.ppt
Informatica_MDM_User_Exits.pptDurganandYedlapati
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングscalaconfjp
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Ngoc Dao
 
Java.script
Java.scriptJava.script
Java.scriptg Nama
 

Similar to @Anywhere (20)

Building @Anywhere (for TXJS)
Building @Anywhere (for TXJS)Building @Anywhere (for TXJS)
Building @Anywhere (for TXJS)
 
Api
ApiApi
Api
 
Qt Workshop
Qt WorkshopQt Workshop
Qt Workshop
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점 Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
 
Net/http and the http.handler interface
Net/http and the http.handler interfaceNet/http and the http.handler interface
Net/http and the http.handler interface
 
Net/http and the http.handler interface
Net/http and the http.handler interfaceNet/http and the http.handler interface
Net/http and the http.handler interface
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
 
Dartprogramming
DartprogrammingDartprogramming
Dartprogramming
 
Android best practices
Android best practicesAndroid best practices
Android best practices
 
Getting Started with Real-Time Analytics
Getting Started with Real-Time AnalyticsGetting Started with Real-Time Analytics
Getting Started with Real-Time Analytics
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node js
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
Retrofitting
RetrofittingRetrofitting
Retrofitting
 
Android the Agile way
Android the Agile wayAndroid the Agile way
Android the Agile way
 
Informatica_MDM_User_Exits.ppt
Informatica_MDM_User_Exits.pptInformatica_MDM_User_Exits.ppt
Informatica_MDM_User_Exits.ppt
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014
 
Java.script
Java.scriptJava.script
Java.script
 
Html
HtmlHtml
Html
 

Recently uploaded

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 

Recently uploaded (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 

@Anywhere

Editor's Notes

  1. Setting up @Anywhere is easy. Let&apos;s start with a simple use case. Hovercards are a feature of Twitter.com that are also available via @Anywhere. Let&apos;s walk through how you can put Hovercards on your site.
  2. If you already have Twitter usernames mentioned in your web site or application, Hovercards provide your users with a small, context-aware tooltip that provides access to data about a particular Twitter user.
  3. Goto http://dev.twitter.com/anywhere and register your application
  4. At the end of the registration process you will be provided with a snippet of JavaScript you can copy and paste into your site.
  5. Let&apos;s take a closer look at the @Anywhere JavaScript that you copy and paste into your site to see how easy it is to work with @Anywhere.
  6. Configuring @Anywhere is easy. When including the @Anywhere JavaScript file you simply pass your API key and the version you want to work with as parameters in the URL.
  7. - When you call the anywhere() method, you pass in a callback that receives a Twitter API client instance as its only argument - By convention we name that argument &quot;T&quot; - All @Anywhere functionality is hung off of the API client instance (&quot;T&quot;)
  8. - T is a function that you can use to scope @Anywhere functionality - By default all @Anywhere functionality operates on the body of the document
  9. - Over the past couple of years CSS selectors have become the preferred means of accessing elements in the DOM - So, with @Anywhere you can pass a CSS selector to T to limit the scope of where the @Anywhere to a particular element or elements in the page - This makes using @Anywhere easy because it is building on techniques most developers are already familiar with
  10. Another design goal of @Anywhere was that it needed to be fast. This was especially important since optimizing client-side/in-browser performance has been a real priority in recent years. We didn&apos;t want developers to worry that by using/including @Anywhere they&apos;d be making some sacrifices regarding performance.
  11. - There is a one to many relationship between anywhere.js and @Anywhere client instances - You only need to include the anywhere.js file once, and can then create any number of @Anywhere client instances (via twttr.anywhere()) per page as illustrated in this example - All @Anywhere client instances share the same script resources
  12. - Additionally, feature-specific resources are loaded on-demand - For example, the TweetBox code is not loaded into the page until the tweetBox() method is called
  13. - Because @Anywhere features are loaded on demand, it makes it very easy to defer the loading and rendering of a given @Anywhere feature until it is request the by the user - In this example, the TweetBox will be not be loaded and rendered until the user clicks the comment button.
  14. - iframes provide self-contained scope for JavaScript and CSS - @Anywhere loads its dependencies into an iframe to keep our scripts sandboxed from those of the host site
  15. - @Anywhere widgets run in an iframe to prevent styles of the host site bleeding in
  16. - Under the hood @Anywhere is simply using the Twitter API. Therefore, there is functionality in @Anywhere that doesn&apos;t require the user to auth. We&apos;ve seen one example of this already: being able to view a user&apos;s profile data in a Hovercard. - For those things that DO require require the user to auth, @Anywhere handles all that for you (completely client-side auth) - In addition you can piggy back on our auth, here&apos;s how
  17. - @Anywhere provides an authComplete and signOut event that can be used to determine whether or not users of your web site or web application have logged in to Twitter and authorized your application for access. - Using the &quot;Connect with Twitter&quot; button it is possible to bind listeners for both the authComplete and signOut events via an object literal passed to the connectButton method. Listeners for the authComplete are passed the logged in user as a single argument.
  18. The connect flow is as follows: 1. Connect launches popup 2. User asked either to: - Auth (if logged in to Twitter) - Login + auth (if not logged in) 3. Single-level of permissions (for simplicity for the user and dev) 4. Tokens are good for 2 hours and are automatically refreshed as long as the user is logged into Twitter
  19. - @Anywhere authentication is via OAuth 2.0 - Not fully implemented all profiles, just what we needed for @Anywhere - Production, non @Anywhere implementations should continue to use the OAuth 1 endpoint until our OAuth 2.0 is deployed - Once we have our OAuth 2.0 endpoint deployed we&apos;ll provide a complete migration plan
  20. - The isConnected() method can be used to determine if the user has already logged in has authorized your web site or application. When the user is connected the &quot;currentUser&quot; property can be used to retrieve information about the logged-in user. - The user object has a data method that can be passed a string representing the property to retrieve. - This example illustrates how to use jQuery and @Anywhere to conditionally display either a Connect with Twitter button, or the user&apos;s screen name and profile image if they&apos;ve already authenticated.
  21. - This example is the same as the previous slide, but uses YUI 3&apos;s method of determining when the page is ready
  22. The authComplete and signOut events are also globally accessible on the Twitter API client instance (T), allowing you to listen for them when triggered by any @Anywhere functionality.
  23. @Anywhere provides a convenient way to link Twitter usernames found in your web site or application back to a user&apos;s profile page on Twitter.com. A Twitter screen name is an &apos;@&apos; symbol followed by 1 to 20 alphanumeric characters, including underscores (&quot;_&quot;). @ev or @biz and two examples of Twitter username.
  24. - To automatically linkify Twitter usernames, simply call T.linkifyUsers() - Calling linkifyUsers in this way would attempt to linkify all potential Twitter users in the &lt;body&gt; of the page.
  25. - To limit the scope of what is linkified, simply pass a CSS selector to the Twitter API client (T). - For example, to linkify only Twitter usernames found in an element with the id of &quot;main&quot;, pass the selector &quot;#main&quot; to T.
  26. API is consistent across each @Anywhere util and widget - Specify the element(s) via selector (omitting selector == apply to &lt;body&gt;) - Call method the collection - Each has options - specified via an object literal
  27. - Developer documentation includes all configuration options for each @Anywhere feature along with working examples
  28. Follow buttons make it easy to provide users of your site or application with a way to follow users on Twitter. Adding Follow Buttons to your web site or web application is easy: simply call T passing in a selector indicating where you want the Follow Button to appear, and call the followButton method specifying a Twitter username.
  29. The Tweet Box allows Twitter users to tweet directly from within your web site or web application. To use the Tweet Box, call T passing in a selector indicating where you want the Tweet Box to appear, and call the tweetBox method.
  30. - @Anywhere also provides a JavaScript implementation of the entire Twitter API - Currently the JavaScript implementation of the Twitter API is in beta, and is not part of the 1.0.0 release - If you&apos;d like to use the JavaScript API, some changes to your @Anywhere configuration are necessary
  31. - Another feature provided by @Anywhere is a JavaScript interface to the REST API. This feature is currently in beta, and is available to developers at Chirp. - To use the JavaScript API you need to modify your configuration of @Anywhere
  32. - All API methods are asynchronous - Can specify a success callback as the second argument to any API method call
  33. If you wish to listen for both success and error, you can specify those listeners via an object literal passed as a second argument to any API method call
  34. Because AJAX operations are asynchronous, calls need to nested
  35. Using the Twitter JavaScript API you can chain methods calls and specify your callback at the end of the chain
  36. The documentation for the JavaScript API can be found at http://platform.twitter.com/js-api.html
  37. When declaring a version number, specifying the version as a whole number will result in @Anywhere using the latest available version for that major version number. For example, if the current available version of @Anywhere is version 1.2.1, specifying a version of 1 will result in @Anywhere using version 1.2.1.
  38. It is also possible to use @Anywhere by declaring a specific version number. Indicating a specific version number will ensure your @Anywhere integration remains on a desired version regardless of the latest available version.
  39. - You can pass the version of @Anywhere as the first argument to the anywhere() method - The primary use case for passing the version as an argument to the anywhere() would be running two different versions of @Anywhere side-by-side on the same page
  40. - Can create multiple instances of the @Anywhere client - Can target an @Anywhere client instance at another window - All instances of the same version share resources
  41. Complete @Anywhere documentation is available at http://dev.twitter.com/anywhere/begin
  42. Developer support provided via the twitter-dev-anywhere Google Group
  43. @Anywhere bugs can be filed via Google Code: http://code.google.com/p/twitter-api/issues/list
  44. Of course you can also find support for @Anywhere via Twitter by following @Anywhere