Display your Instructables on a Wordpress or PHP based page

Ever want to have a listing of your Instrucatbles on a webpage like what is displayed on your profile? I tried several WordPress plugins but came up with nothing so I wrote/came up with a solution.

(UPDATE)

I have written a Plugin for WordPress to do this http://wordpress.org/plugins/instructables/. I have a new instructable for that located here http://www.instructables.com/id/Instructables-Wordpress-Plugin/ I would love feedback from you guys.


In this Instructable I show you how to accomplish this in WordPress and in a simple php based page. You can see a working example here http://mrb.mickred.com/redbeard-on-instructables-com/

Step 1: Checklist

Display your Instructables on a Wordpress or PHP based page
I know it's a short list but seriously you don't need much.

You will need the following:
A WordPress site with the "Exec-PHP" plugin installed, simple PHP page or other content manager that allows php code.
An Instructables profile with at least one Instructable written, note your username.

Step 2: In Wordpress

Display your Instructables on a Wordpress or PHP based page
As stated before you will need the Exec-PHP plugin installed on WordPress for this to work.

Create a new Page then click "Text" as shown in the image below.

Paste in the following code then change "MrRedBeard" to your username in the $url variable.

$url = "http://www.instructables.com/member/MrRedBeard/rss.xml?show=instructable";
$feed = simplexml_load_file($url);
$feed_array = array();
foreach($feed->channel->item as $item)
{
echo " ";
echo "link . "' target='_blank'>";
if(strpos($item->imageThumb,"com"))
{
echo "
";
}
else
{
echo "
";
}
echo "
" . $item->title . " ";
}
echo " "
?>

Page built using this Instructable http://www.instructables.com/id/Display-your-Instructables-on-a-Wordpress-or-PHP-b/

Step 3: Simple PHP page

Display your Instructables on a Wordpress or PHP based page
You can either add the code to an existing page (minus ) or create an entirely new php file using a simple text editor. Change "MrRedBeard" in the $url variable to your username. Once created you can upload this file to your website.

$url = "http://www.instructables.com/member/MrRedBeard/rss.xml?show=instructable";
$feed = simplexml_load_file($url);
$feed_array = array();
foreach($feed->channel->item as $item)
{
echo " ";
echo "link . "' target='_blank'>";
if(strpos($item->imageThumb,"com"))
{
echo "
";
}
else
{
echo "
";
}
echo "
" . $item->title . " ";
}
echo "   "
?>

Page built using this Instructable http://www.instructables.com/id/Display-your-Instructables-on-a-Wordpress-or-PHP-b/

Step 4: Customizations

Display your Instructables on a Wordpress or PHP based page
There more items you can display from the rss feed. You can add to the code by using $item->"item name" like you see in the below code and referencing the rss feed like in the image below.

There are also other feeds like
http://www.instructables.com/member/MrRedBeard/rss.xml?show=comments
http://www.instructables.com/member/MrRedBeard/rss.xml?show=good (favorites)
http://www.instructables.com/member/MrRedBeard/rss.xml?show=subscriptions (new instructables from your followers)

$url = "http://www.instructables.com/member/MrRedBeard/rss.xml?show=instructable";
$feed = simplexml_load_file($url);
$feed_array = array();
foreach($feed->channel->item as $item)
{
echo " ";
echo "link . "' target='_blank'>";
if(strpos($item->imageThumb,"com"))
{
echo "
";
}
else
{
echo "
";
}
echo "
" . $item->title . " ";
}
echo " "
?>

Page built using this Instructable http://www.instructables.com/id/Display-your-Instructables-on-a-Wordpress-or-PHP-b/

Step 5: Questions

I hope you find this Instructable helpful. If you need any help just post your question or issue in the comments section and I'll do my best to help you out.

Updates
First update. If you just published an Instructable it will not show up immediately. Not sure why this is but I will try and note the delay time once it starts to appear. (About 15 minutes after publishing I noticed it showed up)

Second update. Some image paths differ from others, I added code to check for this. I also noticed that the layout looked funny with long titles so I changed the layout a bit.
 
 

Tag cloud

make build easy simple arduino making homemade solar laser printed portable cheap mini building custom cardboard wooden create super lego turn paracord chocolate your paper light intel