Struggling with the WPRestAPI tools

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
lilRalph
Posts: 23
Joined: Wed Aug 26, 2015 9:43 am

Struggling with the WPRestAPI tools

Post by lilRalph » Thu Oct 20, 2016 12:08 pm

I would really like to be able to use the WP Api but I just don't seem to be able to figure out how to use it.

Is there a tutorial of some sort I can follow?

If not can someone please point me in the right direction to pull the data into a stack and call the APIs?

steve_nam
Posts: 60
Joined: Wed Jan 08, 2014 1:09 pm
Location: Windhoek, Namibia

Re: Struggling with the WPRestAPI tools

Post by steve_nam » Sun Feb 12, 2017 7:09 pm

lilRalph,
Any positive feedback on your post/question? I am also struggling in part to grasp the process. I attended June 27 2015 the webinar on the topic "LiveCode + WordPress = Infinite Possibilities" by Todd Fabacher, CEO of Digital Pomegranate. It can be viewed here https://www.youtube.com/watch?v=D_6b04AltTQ . I am currently waiting on the follow up webinar which is meant to deal with the technical aspects of coding/LiveCode. He indicated the webinar will be sometime in February 2017, but has not indicated the date and time. I am equally anxious and eager to succeed on this specific process. I hope we will have it soon.

lilRalph, can you share your success on this theme. Any LiveCoders who can assist in the LiveCode + WordPress endeavor? As members of a supportive community I am REALLY hopeful we will cooperate and assist each other achieving the desired KNOWLEDGE.

Steve
Namibia / Africa

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 229
Joined: Tue Apr 10, 2012 9:18 am

Re: Struggling with the WPRestAPI tools

Post by ghettocottage » Mon Feb 13, 2017 1:17 am

Steve,
Is there something in particular you would like to do with livecode/Wordpress...or are you just interested in general knowledge of the subject?

steve_nam
Posts: 60
Joined: Wed Jan 08, 2014 1:09 pm
Location: Windhoek, Namibia

Re: Struggling with the WPRestAPI tools

Post by steve_nam » Mon Feb 13, 2017 6:29 am

Ghettocottage,
Thanks for you reply. I am very serious in the topic and I would want to recreate a conference schedule app in LiveCode with a WordPress backend. We will have a National ICT Summit later in the year (about Sept/Oct). What Todd Fabacher created for LiveCode Conference from 02-04 August 2016 is the objective/aim of my endeavour.

If you want to assist in achieving this objective I would appreciate it. We can exchange email addresses for correspondence and assistance.

Regards,
Steve
Namibia / Africa

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 229
Joined: Tue Apr 10, 2012 9:18 am

Re: Struggling with the WPRestAPI tools

Post by ghettocottage » Tue Feb 14, 2017 7:53 pm

Currently I am booked, so unable to take on new projects, but I do not mind discussing issues and such here in the forums.

I watched the video on youtube, and it looked promising. Particularly when it comes to using Woocommerce within Livecode. At the same time, I am not a big fan of writing external applications to integrate tightly with a CMS like Wordpress or Joomla. The reason is that CMS's are updated on a regular basis and it can happen that an update might break the external application....so now I amhaving to track down the changes and update the external app to match recent WP updates..

A slightly different approach I have been taking is to add my own tables to a Wordpress database, and then access those tables from within the Wordpress website when I need to pull out some data. Wordpress makes this fairly easy to do if the data is in the same database, using global $wpdb. Wordpress handles the authentication, so you just have to write a query like:

Code: Select all

global $wpdb;
	/*Query the database and get the data from your tables */
		
			$results = $wpdb->get_results(
			"YOUR QUERYYOURTABLE.field
			  FROM whatever AS SOMETHING
			  INNER JOIN  SOMETHINGS
			  LIMIT 12",              
			  ARRAY_A
			 );  ?>

		 <ul class="data">
                        <?php //echo $results[0]['field']; //can grab data outside of loop ?>
                         
                          
			<?php  //or loop through the results to get a string to return
			            foreach($results as $result) :
					//id of the record
 					$data_id= $result['id']; 
					bla bla  ?>
 
..so, with some tables that are not part of the main Wordpress environment, I can store and retrieve data in the Wordpress website. I can even relate these tables to existing wp_users if I need, while still keeping them outside of the Wordpress structure.

Now I can use Livecode to access those external tables, and write whatever app is needed ( for example, an admin app to manage that data)....without fear of a Wordpress update breaking my external app. In fact, I could even ditch Wordpress entirely and use some other web application...or ditch Livecode and use something else to manage the data.

Keeping the database tables you will be using separated from Wordpress tables, and then working directly with those tables in your app can be a manageable way to integrate Livecode and Wordpress without having to manipulate Wordpress overly much.

..in my opinion.

Post Reply

Return to “Internet”