SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
WordPress APIs

       Joseph Scott
  http://josephscott.org/
APIs - The Big Two

     XML-RPC
        &
     AtomPub
XML-RPC Basics
• XML over HTTP POST
• Basic data types (int, bool, string, double,
  dateTime.iso8601, base64) combined with
  structs and arrays
• Supports pipelining with system.multicall
• Authentication generally in request body
• Spec - xmlrpc.com/spec
XML-RPC Request
<?xml version=quot;1.0quot;?>
<methodCall>
	 <methodName>metaWeblog.getPost</methodName>
	 <params>
	   	 <param> <value><int>1</int></value> </param>

	   	 <param> <value><string>admin</string></value> </param>

	 	 <param> <value><string>happiness</string></value> </param>
	 	 </params>
	 </methodCall>
XML-RPC Response
<?xml version=quot;1.0quot;?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member><name>postid</name><value><string>1</string></value></member>
                                                               to
          <member><name>description</name><value><string>Welcome
WordPress. This is your first post. Edit or delete it, then start
blogging!</string></value></member>
       <member><name>title</name><value><string>Hello world!</string><value></
member>
          ...
        </struct>
      </value>
    </param>
  </params>
</methodResponse>
AtomPub Basics
• XML over HTTP (GET, POST, PUT, DELETE)
• Shared base with Atom feeds
• Collections (Posts, Comments, Media),
  Entries (Individual posts and comments)
• Great intro from Joe Gregorio - http://
  bitworking.org/news/343/intro-to-atompub-
  on-youtube
• http://tools.ietf.org/html/rfc5023
AtomPub Request

curl -u “admin:happiness” 
http://localhost/~joseph/wp/trunk/wp-app.php/post/1
AtomPub Response
<?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
<entry xmlns=quot;http://www.w3.org/2005/Atomquot;
       xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;>
	   <id>http://localhost/~joseph/wp/trunk/?p=1</id>
	   <title type=quot;textquot;>Hello world!</title>
	   <updated>2008-08-08T01:01:03Z</updated>
	   <published>2008-08-08T01:01:03Z</published>
	   <app:edited>2008-08-08T01:01:03Z</app:edited>
	   <app:control>
	   	 <app:draft>no</app:draft>
	   </app:control>
	   <author><name>admin</name></author>
	   <link href=quot;http://localhost/~joseph/wp/trunk/?p=1quot; />
	   <content type=quot;textquot;>Welcome to WordPress. This is your first post. Edit or delete
it, then start blogging!</content>
	   <link rel=quot;editquot; href=quot;http://localhost/~joseph/wp/trunk/wp-app.php/post/1quot; />
	   <category scheme=quot;http://localhost/~joseph/wp/trunkquot; term=quot;Uncategorizedquot; />
	   <summary type=quot;textquot;>Welcome to WordPress. This is your first post. Edit or delete
it, then start blogging!</summary>
</entry>
Discovery
• Really Simple Discovery (RSD)
• http://cyber.law.harvard.edu/blogs/gems/tech/
  rsd.html
<link rel=quot;EditURIquot;
type=quot;application/rsd+xmlquot; title=quot;RSDquot;
href=quot;http://localhost/wp/xmlrpc.php?rsdquot; />
RSD
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<rsd version=quot;1.0quot; xmlns=quot;http://archipelago.phrasewise.com/rsdquot;>
 <service>
   <engineName>WordPress</engineName>
   <engineLink>http://wordpress.org/</engineLink>
   <homePageLink>http://localhost/wp</homePageLink>
   <apis>
    <api name=quot;WordPressquot; blogID=quot;1quot; preferred=quot;truequot; apiLink=quot;http://localhost/
wpxmlrpc.phpquot; />
    <api name=quot;Movable Typequot; blogID=quot;1quot; preferred=quot;falsequot; apiLink=quot;http://localhost/wp/
xmlrpc.phpquot; />
    <api name=quot;MetaWeblogquot; blogID=quot;1quot; preferred=quot;falsequot; apiLink=quot;http://localhost/wp/
xmlrpc.phpquot; />
    <api name=quot;Bloggerquot; blogID=quot;1quot; preferred=quot;falsequot; apiLink=quot;http://localhost/wp/
xmlrpc.phpquot; />
    <api name=quot;Atomquot; blogID=quot;quot; preferred=quot;falsequot; apiLink=quot;http://localhost/~joseph/wp/wp-
app.php/servicequot; />
   </apis>
 </service>
</rsd>
4,619

3,079,080
2008 Totals
  4,619
   AtomPub



3,079,080
  XML-RPC
2009 Year To Date
     3,312
      AtomPub



    703,673
      XML-RPC
XML-RPC Blog APIs
 MetaWeblog
                       WordPress
(metaWeblog.*)
                        (wp.*)

          Blogger
                           Movable Type
         (blogger.*)
                             (mt.*)
Extending MetaWeblog
• Many new fields to getPost/newPost/editPost
 • wp_slug, wp_password, wp_author_id,
    wp_author_display_name,
    date_created_gmt, post_status,
    custom_fields, mt_keywords (tags)
• dateCreated vs. date_created_gmt
WordPress Methods
• Comment Management, new in 2.7
  (wp.getComment, wp.newComment,
  wp.editComment, wp.deleteComment)
• Page management (wp.getPage, wp.editPage,
  wp.newPage, etc.)
• Category Management (wp.newCategory,
  wp.deleteCategory, etc.)
• Tag Management (wp.getTags - more to come)
Applications
Windows Live Writer
                        MarsEdit
More Applications
  http://codex.wordpress.org/Weblog_Client

• Scribefire (Firefox Plugin)
• Windows- MS Word 2007, Blogdesk, Blogjet,
  Raven, Flock, Qumana
• Mac - Ecto, Blogo, MacJournal, TextMate
• Linux - QTM, Gnome Blog, Drivel, BloGTK
iPhone App
 • http://iphone.wordpress.org/
 • Free & Open Source (GPL)
 • ~ 165,000 downloads
 • Uses XML-RPC to manage
   your blog
iPhone App - 1.2
http://iphone.wordpress.org/2008/11/11/help-test-
         wordpress-for-iphone-version-12/

 • Comment Moderation
 • Landscape mode
 • Link creation help
 • Create/edit Pages
iPhone App

      231,079

Posts in the last 6 months
Developer Tools - Mac
        HTTPScoop
        http://www.tuffcode.com/


           XML-RPC Client
           http://ditchnet.org/xmlrpc/
Developer Tools - Windows
Fiddler
http://www.fiddlertool.com/fiddler/
XML-RPC for WP Devs
  • Add your own XML-RPC methods
add_filter( 'xmlrpc_methods', 'joseph_attach_xmlrpc_methods' );
function joseph_attach_xmlrpc_methods( $methods ) {
   $methods['joseph.hello'] = 'joseph_xmlrpc_hello';
   return $methods;
}
XML-RPC for WP Devs
     • Add your own XML-RPC methods
function joseph_xmlrpc_hello( $args ) {
   if ( empty( $args[0] ) )
       return new IXR_Error( 2000, __( 'No name was provided.' ) );

    $salutation = quot;Hello {$args[0]}, nice to see you!quot;;

    return $salutation;
}
XML-RPC for WP Devs
   • XML-RPC Client
$rpc = new IXR_Client( 'http://example.com/xmlrpc.php' );

$status = $rpc->query( ‘demo.addTwoNumbers’, 4, 5 );
if ( !$status ) {
    print ‘Error ( ‘ . $rpc->getErrorCode( ) . ‘ ): ‘;
    print $rpc->getErrorMessage( ) . “n”;
    exit;
}

$result = $rpc->getResponse( );
bbPress XML-RPC
• Part of version 1.0 (when it comes out)
• Pingback support
• bbPress Live - WordPress Plugin
• BuddyPress forums
Going Forward
• More data/features exposed via XML-RPC &
  AtomPub
 • Everything wp-admin can do?
• Likely a WordPress namespace for new
  AtomPub features
Username
Password
OAuth

Username
Password
Applications On Top
  of WordPress
InterPress
XML-RPC Developers
http://lists.automattic.com/mailman/listinfo/wp-xmlrpc
Thank You
Find Me

• http://josephscott.org/
• joseph@josephscott.org
• http://twitter.com/josephscott/
• #wordpress-dev

Weitere ähnliche Inhalte

Was ist angesagt?

Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...Jazkarta, Inc.
 
Doing more with LESS
Doing more with LESSDoing more with LESS
Doing more with LESSjsmith92
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2fishwarter
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5dynamis
 
Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Steve Souders
 
Browser Extensions for Web Hackers
Browser Extensions for Web HackersBrowser Extensions for Web Hackers
Browser Extensions for Web HackersMark Wubben
 
You don’t know JS about SharePoint - Mastering javascript performance (Hugh W...
You don’t know JS about SharePoint - Mastering javascript performance (Hugh W...You don’t know JS about SharePoint - Mastering javascript performance (Hugh W...
You don’t know JS about SharePoint - Mastering javascript performance (Hugh W...Rencore
 
Transients are good for you - WordCamp London 2016
Transients are good for you - WordCamp London 2016Transients are good for you - WordCamp London 2016
Transients are good for you - WordCamp London 2016Boiteaweb
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video PlayerJim Jeffers
 
Drawing the Line with Browser Compatibility
Drawing the Line with Browser CompatibilityDrawing the Line with Browser Compatibility
Drawing the Line with Browser Compatibilityjsmith92
 
49368010 projectreportontraininganddevelopment(1)
49368010 projectreportontraininganddevelopment(1)49368010 projectreportontraininganddevelopment(1)
49368010 projectreportontraininganddevelopment(1)Kritika910
 
Desafios do Profissionalismo Ágil
Desafios do Profissionalismo ÁgilDesafios do Profissionalismo Ágil
Desafios do Profissionalismo ÁgilVictor Hugo Germano
 
Building a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBuilding a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBen Limmer
 
LESS is More
LESS is MoreLESS is More
LESS is Morejsmith92
 
Nahlédněte za oponu VersionPressu
Nahlédněte za oponu VersionPressuNahlédněte za oponu VersionPressu
Nahlédněte za oponu VersionPressuJan Voracek
 

Was ist angesagt? (20)

Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
Deliverance: Plone theming without the learning curve from Plone Symposium Ea...
 
DevDays09 Internet Explorer 8
DevDays09 Internet Explorer 8DevDays09 Internet Explorer 8
DevDays09 Internet Explorer 8
 
Doing more with LESS
Doing more with LESSDoing more with LESS
Doing more with LESS
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
WordPress and Ajax
WordPress and AjaxWordPress and Ajax
WordPress and Ajax
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5
 
Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09
 
Browser Extensions for Web Hackers
Browser Extensions for Web HackersBrowser Extensions for Web Hackers
Browser Extensions for Web Hackers
 
You don’t know JS about SharePoint - Mastering javascript performance (Hugh W...
You don’t know JS about SharePoint - Mastering javascript performance (Hugh W...You don’t know JS about SharePoint - Mastering javascript performance (Hugh W...
You don’t know JS about SharePoint - Mastering javascript performance (Hugh W...
 
Transients are good for you - WordCamp London 2016
Transients are good for you - WordCamp London 2016Transients are good for you - WordCamp London 2016
Transients are good for you - WordCamp London 2016
 
Django
DjangoDjango
Django
 
Building an HTML5 Video Player
Building an HTML5 Video PlayerBuilding an HTML5 Video Player
Building an HTML5 Video Player
 
Drawing the Line with Browser Compatibility
Drawing the Line with Browser CompatibilityDrawing the Line with Browser Compatibility
Drawing the Line with Browser Compatibility
 
Makezine
MakezineMakezine
Makezine
 
49368010 projectreportontraininganddevelopment(1)
49368010 projectreportontraininganddevelopment(1)49368010 projectreportontraininganddevelopment(1)
49368010 projectreportontraininganddevelopment(1)
 
Desafios do Profissionalismo Ágil
Desafios do Profissionalismo ÁgilDesafios do Profissionalismo Ágil
Desafios do Profissionalismo Ágil
 
Building a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBuilding a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profit
 
LESS is More
LESS is MoreLESS is More
LESS is More
 
Nahlédněte za oponu VersionPressu
Nahlédněte za oponu VersionPressuNahlédněte za oponu VersionPressu
Nahlédněte za oponu VersionPressu
 
New Browsers
New BrowsersNew Browsers
New Browsers
 

Ähnlich wie WordPress APIs

GTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationGTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationDavid Calavera
 
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Michael Wales
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)Carles Farré
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax componentsIgnacio Coloma
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone InteractivityEric Steele
 
The Real Time Web with XMPP
The Real Time Web with XMPPThe Real Time Web with XMPP
The Real Time Web with XMPPJack Moffitt
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixBruce Snyder
 
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Tatsuhiko Miyagawa
 
Exploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your pluginsExploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your pluginsMarian Marinov
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyChristian Thilmany
 
Adventurous Merb
Adventurous MerbAdventurous Merb
Adventurous MerbMatt Todd
 
Orbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case StudyOrbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case StudyMark Meeker
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To LampAmzad Hossain
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkDirk Haun
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructureLiving in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructurePamela Fox
 

Ähnlich wie WordPress APIs (20)

GTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationGTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementation
 
T5 Oli Aro
T5 Oli AroT5 Oli Aro
T5 Oli Aro
 
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
Introduction to CodeIgniter (RefreshAugusta, 20 May 2009)
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 
Php
PhpPhp
Php
 
Rack Middleware
Rack MiddlewareRack Middleware
Rack Middleware
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone Interactivity
 
Jsp
JspJsp
Jsp
 
The Real Time Web with XMPP
The Real Time Web with XMPPThe Real Time Web with XMPP
The Real Time Web with XMPP
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMix
 
Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8Web Scraper Shibuya.pm tech talk #8
Web Scraper Shibuya.pm tech talk #8
 
Exploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your pluginsExploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your plugins
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian Thilmany
 
Ridingapachecamel
RidingapachecamelRidingapachecamel
Ridingapachecamel
 
Adventurous Merb
Adventurous MerbAdventurous Merb
Adventurous Merb
 
Orbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case StudyOrbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case Study
 
Introduction To Lamp
Introduction To LampIntroduction To Lamp
Introduction To Lamp
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructureLiving in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
 

Mehr von Joseph Scott

Site Testing with CasperJS
Site Testing with CasperJSSite Testing with CasperJS
Site Testing with CasperJSJoseph Scott
 
Improving Front End Performance
Improving Front End PerformanceImproving Front End Performance
Improving Front End PerformanceJoseph Scott
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariJoseph Scott
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Joseph Scott
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & ScalabilityJoseph Scott
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & ScalabilityJoseph Scott
 

Mehr von Joseph Scott (9)

Scaling WordPress
Scaling WordPressScaling WordPress
Scaling WordPress
 
Site Testing with CasperJS
Site Testing with CasperJSSite Testing with CasperJS
Site Testing with CasperJS
 
Python & FUSE
Python & FUSEPython & FUSE
Python & FUSE
 
Improving Front End Performance
Improving Front End PerformanceImproving Front End Performance
Improving Front End Performance
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & Scalability
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & Scalability
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 

Kürzlich hochgeladen

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
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
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Kürzlich hochgeladen (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
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
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

WordPress APIs

  • 1. WordPress APIs Joseph Scott http://josephscott.org/
  • 2. APIs - The Big Two XML-RPC & AtomPub
  • 3. XML-RPC Basics • XML over HTTP POST • Basic data types (int, bool, string, double, dateTime.iso8601, base64) combined with structs and arrays • Supports pipelining with system.multicall • Authentication generally in request body • Spec - xmlrpc.com/spec
  • 4. XML-RPC Request <?xml version=quot;1.0quot;?> <methodCall> <methodName>metaWeblog.getPost</methodName> <params> <param> <value><int>1</int></value> </param> <param> <value><string>admin</string></value> </param> <param> <value><string>happiness</string></value> </param> </params> </methodCall>
  • 5. XML-RPC Response <?xml version=quot;1.0quot;?> <methodResponse> <params> <param> <value> <struct> <member><name>postid</name><value><string>1</string></value></member> to <member><name>description</name><value><string>Welcome WordPress. This is your first post. Edit or delete it, then start blogging!</string></value></member> <member><name>title</name><value><string>Hello world!</string><value></ member> ... </struct> </value> </param> </params> </methodResponse>
  • 6. AtomPub Basics • XML over HTTP (GET, POST, PUT, DELETE) • Shared base with Atom feeds • Collections (Posts, Comments, Media), Entries (Individual posts and comments) • Great intro from Joe Gregorio - http:// bitworking.org/news/343/intro-to-atompub- on-youtube • http://tools.ietf.org/html/rfc5023
  • 7. AtomPub Request curl -u “admin:happiness” http://localhost/~joseph/wp/trunk/wp-app.php/post/1
  • 8. AtomPub Response <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <entry xmlns=quot;http://www.w3.org/2005/Atomquot; xmlns:app=quot;http://www.w3.org/2007/appquot; xml:lang=quot;enquot;> <id>http://localhost/~joseph/wp/trunk/?p=1</id> <title type=quot;textquot;>Hello world!</title> <updated>2008-08-08T01:01:03Z</updated> <published>2008-08-08T01:01:03Z</published> <app:edited>2008-08-08T01:01:03Z</app:edited> <app:control> <app:draft>no</app:draft> </app:control> <author><name>admin</name></author> <link href=quot;http://localhost/~joseph/wp/trunk/?p=1quot; /> <content type=quot;textquot;>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</content> <link rel=quot;editquot; href=quot;http://localhost/~joseph/wp/trunk/wp-app.php/post/1quot; /> <category scheme=quot;http://localhost/~joseph/wp/trunkquot; term=quot;Uncategorizedquot; /> <summary type=quot;textquot;>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</summary> </entry>
  • 9. Discovery • Really Simple Discovery (RSD) • http://cyber.law.harvard.edu/blogs/gems/tech/ rsd.html <link rel=quot;EditURIquot; type=quot;application/rsd+xmlquot; title=quot;RSDquot; href=quot;http://localhost/wp/xmlrpc.php?rsdquot; />
  • 10. RSD <?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?> <rsd version=quot;1.0quot; xmlns=quot;http://archipelago.phrasewise.com/rsdquot;> <service> <engineName>WordPress</engineName> <engineLink>http://wordpress.org/</engineLink> <homePageLink>http://localhost/wp</homePageLink> <apis> <api name=quot;WordPressquot; blogID=quot;1quot; preferred=quot;truequot; apiLink=quot;http://localhost/ wpxmlrpc.phpquot; /> <api name=quot;Movable Typequot; blogID=quot;1quot; preferred=quot;falsequot; apiLink=quot;http://localhost/wp/ xmlrpc.phpquot; /> <api name=quot;MetaWeblogquot; blogID=quot;1quot; preferred=quot;falsequot; apiLink=quot;http://localhost/wp/ xmlrpc.phpquot; /> <api name=quot;Bloggerquot; blogID=quot;1quot; preferred=quot;falsequot; apiLink=quot;http://localhost/wp/ xmlrpc.phpquot; /> <api name=quot;Atomquot; blogID=quot;quot; preferred=quot;falsequot; apiLink=quot;http://localhost/~joseph/wp/wp- app.php/servicequot; /> </apis> </service> </rsd>
  • 12. 2008 Totals 4,619 AtomPub 3,079,080 XML-RPC
  • 13. 2009 Year To Date 3,312 AtomPub 703,673 XML-RPC
  • 14. XML-RPC Blog APIs MetaWeblog WordPress (metaWeblog.*) (wp.*) Blogger Movable Type (blogger.*) (mt.*)
  • 15. Extending MetaWeblog • Many new fields to getPost/newPost/editPost • wp_slug, wp_password, wp_author_id, wp_author_display_name, date_created_gmt, post_status, custom_fields, mt_keywords (tags) • dateCreated vs. date_created_gmt
  • 16. WordPress Methods • Comment Management, new in 2.7 (wp.getComment, wp.newComment, wp.editComment, wp.deleteComment) • Page management (wp.getPage, wp.editPage, wp.newPage, etc.) • Category Management (wp.newCategory, wp.deleteCategory, etc.) • Tag Management (wp.getTags - more to come)
  • 18. More Applications http://codex.wordpress.org/Weblog_Client • Scribefire (Firefox Plugin) • Windows- MS Word 2007, Blogdesk, Blogjet, Raven, Flock, Qumana • Mac - Ecto, Blogo, MacJournal, TextMate • Linux - QTM, Gnome Blog, Drivel, BloGTK
  • 19. iPhone App • http://iphone.wordpress.org/ • Free & Open Source (GPL) • ~ 165,000 downloads • Uses XML-RPC to manage your blog
  • 20. iPhone App - 1.2 http://iphone.wordpress.org/2008/11/11/help-test- wordpress-for-iphone-version-12/ • Comment Moderation • Landscape mode • Link creation help • Create/edit Pages
  • 21. iPhone App 231,079 Posts in the last 6 months
  • 22. Developer Tools - Mac HTTPScoop http://www.tuffcode.com/ XML-RPC Client http://ditchnet.org/xmlrpc/
  • 23. Developer Tools - Windows Fiddler http://www.fiddlertool.com/fiddler/
  • 24. XML-RPC for WP Devs • Add your own XML-RPC methods add_filter( 'xmlrpc_methods', 'joseph_attach_xmlrpc_methods' ); function joseph_attach_xmlrpc_methods( $methods ) { $methods['joseph.hello'] = 'joseph_xmlrpc_hello'; return $methods; }
  • 25. XML-RPC for WP Devs • Add your own XML-RPC methods function joseph_xmlrpc_hello( $args ) { if ( empty( $args[0] ) ) return new IXR_Error( 2000, __( 'No name was provided.' ) ); $salutation = quot;Hello {$args[0]}, nice to see you!quot;; return $salutation; }
  • 26. XML-RPC for WP Devs • XML-RPC Client $rpc = new IXR_Client( 'http://example.com/xmlrpc.php' ); $status = $rpc->query( ‘demo.addTwoNumbers’, 4, 5 ); if ( !$status ) { print ‘Error ( ‘ . $rpc->getErrorCode( ) . ‘ ): ‘; print $rpc->getErrorMessage( ) . “n”; exit; } $result = $rpc->getResponse( );
  • 27. bbPress XML-RPC • Part of version 1.0 (when it comes out) • Pingback support • bbPress Live - WordPress Plugin • BuddyPress forums
  • 28. Going Forward • More data/features exposed via XML-RPC & AtomPub • Everything wp-admin can do? • Likely a WordPress namespace for new AtomPub features
  • 31. Applications On Top of WordPress
  • 35. Find Me • http://josephscott.org/ • joseph@josephscott.org • http://twitter.com/josephscott/ • #wordpress-dev