In this tutorial, we go over how to scrape a remote data source (API) and store that data in a Custom Post Type that has a set of Advanced Custom Fields. This is a real-world project that I used to create a timed-scrape for a side project.
Sign up for the newsletter to notified about the free 2020 WordPress Development Course: https://wpcasts.tv
Get WordPress Hosting:
http://wpcasts.tv/go/kinsta
**Don’t forget to subscribe!**
***Make sure to visit the live project: https://brewla.la/ ***
Correction at 33:51 – “weekly” is a custom interval. You have to create that on your own with something like this: https://developer.wordpress.org/plugins/cron/understanding-wp-cron-scheduling/
** FULL CODE REPOSITORY **
https://github.com/alexander-young/brewlala
**SOCIAL**
Twitter: https://twitter.com/_WPCasts_tv_
Instagram: https://www.instagram.com/the_alex_young/
#WordPress #API #RealWorldProject
source
Sign up for the newsletter to notified about the free 2020 WordPress Development Course: https://wpcasts.tv
Increible tutorial, ya con esto lo combinas con un oage builder y haces magia, de verdad muchas gracias
Thank you. I have an api in which I’m registered with id and password, why wp_remote_get return me an unauthorized response ?
how can we register a hook to external api. lets say I have api, it spits out changes based on some events. I want to hook/listen to those changes in wordpress. (API hooks)
Hi , i have a question about this part 'if( $brewery->updated_at >= $exisiting_brewerey_timestamp )' , why you checking '>=' , then condition will always be true , not only if job 'updated on' was bigger , also you are checking if post exists by 'slug' , if in the api title is changed , that will be considered as a new post , which will add post twice
Wow! its very usefull. I have one question, What theme do you used in this example?
Please create more videos on API integration in wordpress. And thank you so much for such a Great video sir 😊❤️
Correct me if I'm wrong, but when you put >= on line 73 (31:40), the = takes away the whole purpose of the function, which would be to update only the newest ones (>). Those with the same timestamp (=) shouldn't be updated.
The tutorial is excellent, and it helped me a lot. Thanks. 👍
related video https://www.youtube.com/watch?v=HqXw9rSffaU
Cool, but what If I don't have an 'updated at' value return from my data? How can I check if the information was updated?
clap clap clap! 🙂
Is this storing the breweries data into the wp MySql server? Or is it calling it every time the costomer comes. If it does call it once and store it then how do you handle updates?
Great tutorial! I'm trying to figure out how to import products into WooCommerce via an API. This has helped me immensely.
where do you save the edited code in the wordpress?
this is amazing. really well explained and informative. thank you.
Thank you for this very useful tutorial. However in my case I was not able to write the fields created by ACF. I was able to see the post titles in the custom post type I created however not necessarily the contents of the ACF fields I created. What in your opinion is the problem? Thank you…
good tutorial but storing a db in wordpress is archaic and dumb because you do not get real time data, it relies on a constant stream of data from the host to the wordpress data. this is really piss poor way of doing things. what is the point of having an API if you cant query the customers database which is never going to be in the wordpress eco system. use a real website and code and get the job done properly – hate me if you want, anyone who is a real programmer will not disagree with that.
Hi, do you offer a development service? I need something list this with little bit of modifications. Thanks
Wow. This tutorial is really good and you made it very easy to follow without skipping important parts and giving a clear path to follow. I'm glad I found the video!
Amazing video! Thank you!
Excellent. I got a bit confused by the end but overall, thank you for showing everything from scratch instead of keep saying "i already wrote half of the code offsceen".
Hi, first of all great video! Learned a lot from it. I have one question, What if a brewery is deleted from the API? How will you find the obsolete brewary in your WordPress database and delete it there as well? What checks can we run to achieve this?
Hi there, You have REST API videos, Any video about sending wordpress posts to external REST API ? Any information , Pls let me know THANKS
Congrats for the tutorial. It really helped me.
Can we create the CPT with a plugin instead of coding?
Any idea as to why there would be two entries created instead of just one? They both have the same permalink but show up twice in the Breweries CPT.
This is a legendary WP video!!
😍😍 Amazing Video 😍😍
I sent you an email and haven't heard back. Is there a better way of getting hold of you? Looking to hire for something very similar to this.
How could i work with products instead of custom post?
Very clear and well explained. Thank alot.
At https://youtu.be/LWM41Rcao3s?t=711 couldn't you use just while loop and increment page number?