Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Talking to Other Sites with the WP HTTP API

194 views

Published on

Lightning talk from Grand Rapids Word Camp 2019. Discusses why and how to talk to other sites, no code samples.

Published in: Internet
  • Login to see the comments

  • Be the first to like this

Talking to Other Sites with the WP HTTP API

  1. 1. Talking to Other Sites with the WP HTTP API Presenter Topher DeRosia @topher1kenobe Date 13 July 2019
  2. 2. Why Talk To Other Sites? Eventbrite A complete API for managing events. https://www.eventbrite.com/platform/ CIA World Fact Book Details about every country in the world. https://iancoleman.io/exploring-the-cia- world-factbook/ The Movie Database API (TMDb) All the data about every movie ever made. https://developers.themoviedb.org/3/ge tting-started/introduction To ask them questions. How many tickets are left for my favorite concert? What movies are playing this week? How many people live in Sri Lanka? To tell them things. Buy that ticket. Email me when a certain movie appears.
  3. 3. How is this done? Always look at https://codex.wordpress.org/HTTP_API • wp_remote_get() - Retrieves a URL using the GET HTTP method. • wp_remote_post() - Retrieves a URL using the POST HTTP method. • wp_remote_head() - Retrieves a URL using the HEAD HTTP method. • wp_remote_request() - Retrieves a URL using either the default GET or a custom HTTP method (should be caps) that you specify.
  4. 4. Examples https://joshuaproject.net/resources/datasets All people groups in a specific country http://joshuaproject.net/api/v2/people_groups?ROG3=YM&api_key=aWye9lV20QtF A people group in a specific country http://joshuaproject.net/api/v2/people_groups?ROG3=AF&PeopleID3=19409&api_key=aWye9lV20QtF All countries a specific people group lives in http://joshuaproject.net/api/v2/people_groups?PeopleID3=10294&api_key=aWye9lV20QtF
  5. 5. Thank you Make WordPress Slack: @topher1kenobe Twitter: @topher1kenobe Email: topher@bigcommerce.com

×