Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Publish a Post Screaming

Publish a Post Screaming

The main idea of this talk is to show new possibilities about how you can interact the WP REST API with small devices like RaspberryPi.

This talk was presented in WordCamp New York City 2018:
https://2018.nyc.wordcamp.org/sessions/#wcorg-session-2742

This talk was presented in WordCamp Miami 2018: https://2018.miami.wordcamp.org/session/interacting-with-wordpress-w-raspberry-pi-rest-api/

Here is the result of the presentation: http://rest.donini.me/congratulations-wordcamp-miami-2018-you-reach-36-decibels-wcmia/

Rodrigo Donini

March 17, 2018
Tweet

More Decks by Rodrigo Donini

Other Decks in Programming

Transcript

  1. Hire the top 3% of freelance talent www.toptal.com Toptal Confidential

    HELLO! I’m Donini You can find me on Twitter, GitHub and LinkedIn as @donini My Site / Blog: www.donini.me Apply for Toptal: http://bit.ly/donini-toptal
  2. Hire the top 3% of freelance talent www.toptal.com Toptal Confidential

    WordCamp Buenos Aires - AR WordCamp San José - CR WordCamp Toronto - CA WordCamp Porto Alegre - BR Where I live São Leopoldo MORE THEN 37 THOUSAND MILES (+68 thousand kilometers) TO ATTEND WORDCAMPS WordCamp São Paulo - BR WordCamp Miami - US WordCamp New York - US
  3. Hire the top 3% of freelance talent www.toptal.com Toptal Confidential

    Hire the 3% of the best freelancers in the world. WHO IS http://bit.ly/donini-toptal @donini
  4. Hire the top 3% of freelance talent www.toptal.com Toptal Confidential

    ! The challenges ! Landscape ! References ! Overview of the REST-API ! Decibel-meter Package ! Live code ! Live preview Agenda @donini
  5. Hire the top 3% of freelance talent www.toptal.com Toptal Confidential

    The Main Challenges @donini • Consume and show a practical example of using the WP REST API • Interact with the audience somehow.
  6. Hire the top 3% of freelance talent www.toptal.com Toptal Confidential

    Landscape (The Premise) @donini The audience make some noise (Scream for example) If the system reach a number of decibels A new post will be published through the REST API
  7. Hire the top 3% of freelance talent www.toptal.com Toptal Confidential

    Quick overview of the REST-API @donini Characteristics of the WordPress REST API: 1) It’s possible manipulate posts, custom-posts, pages, categories, tags, comments, taxonomies, media, users and settings; 2) Uses the HTTP methods to transmit data, like POST, GET, PUT, DELETE; 3) Don’t need extra knowledge of PHP.
  8. Hire the top 3% of freelance talent www.toptal.com Toptal Confidential

    Using the REST-API @donini Endpoints to manipulate posts: Create: POST /wp/v2/posts Update: POST /wp/v2/posts/<id> Delete: DELETE /wp/v2/posts/<id> List: GET /wp/v2/posts Restore: GET /wp/v2/posts/<id> https://developer.wordpress.org/rest-api/reference/posts/
  9. Hire the top 3% of freelance talent www.toptal.com Toptal Confidential

    @donini https://developer.wordpress.org/rest-api/reference/posts/ In this project we used two Endpoints To create the post in WordPress: Create: POST /wp/v2/posts To upload the media file: Create: POST /wp/v2/media
  10. Hire the top 3% of freelance talent www.toptal.com Toptal Confidential

    Some applications of the REST-API @donini 1) Build websites or webapps using React.js, Angular.js, Vue.js, etc; 2) Build mobile apps using Java (Android), Swift (iOS), etc; 3) Integrate with any device that supports REST APIs;
  11. Hire the top 3% of freelance talent www.toptal.com Toptal Confidential

    Decibel-meter Package @donini 1) Connects in audio devices; 2) Process and capture the decibels;
  12. Hire the top 3% of freelance talent www.toptal.com Toptal Confidential

    References and Libs @donini 1) Project in Github - https://github.com/donini/scream-and-post 3) WP REST API - https://developer.wordpress.org/rest-api/reference/ 4) Decibel-meter npm package - https://www.npmjs.com/package/decibel-meter 5) Express npm package - http://expressjs.com/ 6) Gifshot - https://github.com/yahoo/gifshot
  13. THANKS! You can find me on Twitter, GitHub and LinkedIn

    as @donini My Site / Blog: www.donini.me QUESTIONS? Apply to Toptal: http://bit.ly/donini-toptal
  14. Hire the top 3% of freelance talent www.toptal.com Toptal Confidential

    FTM & CoffeePress @donini http://bit.ly/coffeepressyt