This Instructable shows you how you can embed a list of links to your Instructables on your website, formatted just like on your profile page. They're updated automatically each time the page is loaded and are sortable by views, rating, recent and name. You can navigate through the pages of your Instructables by clicking the "Prev" and "Next" buttons, or by editing the "offset" in the URL.

Your profile page is fetched using PHP and the links and pictures scraped out of the html code from Instructables. These are then rearranged to look like the standard Instructables layout, your visitors clicking on them will take them straight to your Instructable.

All images are "hot linked", so there's no impact on your web server storage or bandwidth. All of this is done with the kind permission of Eric.

A list of some of the sites that have successfully installed this so far:
redtorope.com/instructables (mine)

A full list of users that have used it successfully will be added to the last step and updated when I learn of new uptakes.

Many thanks to gmjhowe for helping me write the HTML and CSS used to make the results the PHP finds look pretty and for taking great photos for this Ible.

I have previously fetched web pages with Perl; this is my first attempt with PHP. A list of resources in the last step shows the websites that I used to learn how to do this, all of these were invaluable.

Step 1: How It Works

This step isn't important if you just want to use the code and be done with it, it's just for interest.

The code works in these steps:
  1. The PHP uses the $_GET function to get the information stored in the offset and sort variable in the URL, just like it does on Instructables.
  2. A URL for the Instructables page to be fetched is constructed from the variables $sort, $offset and $username. Depending on the user to be displayed, the sort method to be used and the number to offset by, it may look something like this: https://www.instructables.com/member/Jayefuu/?show=INSTRUCTABLES&sort=NAME&limit=15&offset=15
  3. The Instructables page constructed in step 2 is fetching using the PHP function curl() and stored in the variable $html.
  4. A list of links replicate the "sort by" function included in Instructables. Clicking these takes users to the same page, but changes the "sort=NAME" part of the URL.  The current sort method isn't a link, it's in bold.
  5. A regular expression is used to determine whether there is a next or previous button on the page fetched. These are then printed to the screen.
  6. One massive regular expression is used to find the 15 Instructables on the page. Their titles, URLS, title image thumbnails and featured status are stored in an array.
  7. A piece of code iterates through the array and prints html to the screen. This is what is displayed by your browser, not the PHP, which is executed on the server.
<p>That was beautiful you shared the great post with us, I'm really glad to see this type of info thank you so much for sharing this positive and interested post between us doing excellent work keep it up. If here anyone interested to visit this site http://www.excellentacademichelp.com/thesis-writing/ to solve his or her problems which you are faced in your academic carrier then visit it's help you to solve your problem which you are faced in you academic carrier. </p>
Can somebody please help me do this. I don't mind paying. I have tried to take this on but have hit a dead end....
I would like to add this to the blog on www.sfxc.co.uk
<p>I try to earn some money via creating websites. I am not a professional webmaster, so I use easy and flexible web builder Moto CMS3 <a href="http://www.templatemonster.com/moto-cms-3-templates.php" rel="nofollow">http://www.templatemonster.com/moto-cms-3-templates.php</a> . All clients always remain pleased with the results. You can try it too.</p>
<p>Actually good tips, thanks.</p>
<p>Wow this is a nice idea. </p><p><a href="http://www.awesomehowto.com/" rel="nofollow">http://www.awesomehowto.com/</a></p><p>this is my website can you suggest what type of post I can show? anyone please suggest me and to this have filters to only post speficif posts?</p>
<p>it looks like non of the reference websites is working:</p><ul><br><li>Jayefuu - <a href="http://www.redtorope.com/instructables/">redtorope.com/instructables</a> (wordpress blog)<li>Gmjhowe - <a href="http://www.gmjhowe.com/instructables">gmjhowe.com/tutorials</a> (custom site)<li>Zieak -<a href="http://www.zieak.com/instructables-2/"> zieak.com/instructables-2</a> (wordpress blog)</ul><p>Some html/css/php geek that can help me out? I realy want to try this on my website: www.vincentverheggen.nl</p>
In Wordpress 3.3. I had to add the unfilter plug-in for it to work. Since it is on a private server it will not be that big of deal.
I finally got it working on <a href="http://www.zieak.com/instructables-2/">my site</a>. I have a self-hosted wordpress setup. I had to take the code from step 3.4 and put it into the page text (I put it at the beginning.)<br> <br> I banged up some of the code in other places on my site so need to go fix that...<br> <br> Thank you so much for this!<br>
Hi zieak. I visited your website, you need to update to the new code since HQ changed the HTML on profile pages. It's just a couple of lines around the regex to hunt the names/images.
I added a link and a screen shot to the last step.
Nice! Glad it works, thanks.
I wonder is there a decent way to pull the profile card, with all the info on it on to a site... Going to experiment but any suggestions or help would be awesome...
Would be pretty easy to be honest. You could snip some of the code out of my script if you wanted to do it yourself. Or wait til the weekend and I'll do it for you, it's a good idea and quite interesting :D<br> <br> If you do do it yourself this page will help:<br> <a href="https://www.instructables.com/member/Jayefuu/statscard">https://www.instructables.com/member/Jayefuu/statscard</a><br>
Awesome, I'll have to take a crack at it, didn't know about that little page trick... <br> <br>When's the next views count by the way? Not far from 1M now...
I want it to work on Blogger. Baaaaaaah! Is there a way to run the script and have it spit out the HTML? It'll mean manually updating with each new Instructable, but it could be a real time saver for retrieving info. Or it could just be a stupid idea. :-P
I think you'll probably have the same problem as jen7714. Since you don't pay for your hosting, blogger don't give you the power to do as much as someone that does host their blog on their own hosting. It could probably be made to work for blogger, I can't imagine why not, but I don't think you'll have the access or privileges required to do so on a .blogspot.com blog.
On a side note to that a huge number of free hosts will allow you to use various extra languages you just have to enable them on your profile, never used blogger personally though.
Ahhh I was getting all excited about getting all my instructables on my blog but them another problem awaits. Apparently, worpress.<strong>com</strong> (the free one) doesn't allow <a href="http://en.support.wordpress.com/plugins/">plugins. </a><br> <br> Any way to work around that?<br>
Oh no.<br><br>I can't think of a way around that, sorry. You could have a static version, but that wouldn't be as fun :)
Blehh. :( But a static version might be better than nothing. Or I'll just link...
In order to make it work, I had to install php5-curl:&nbsp;(<em>sudo apt-get install php5-curl</em>&nbsp;on ubuntu/debian), and it stil didn't work until I've added to php.ini the line&nbsp;<em>extension=php_curl.so</em>.<br> Works now, though :)
Spoke to soon: the video play button has src=&quot;/static/img/playVideo_huge.png&quot; (i.e. on my own server) and comes out broken :(
Videos! I forgot about videos! I don't have any so I didn't think to do it. Will update it tonight when I get home. It's a problem in the regular expression line that sorts all 15 ibles from the HTML.<br><br>Thanks.<br><br>Care to add a link to your site here?
It's actually localhost, but when I do a facelift to http://zzzen.com I'm thinking of using this
Ahhh brilliant. Glad you got it working locally. I forgot that I had to uncomment that line in php.ini.
.&nbsp; Fantastic!<br> <br> <br> .&nbsp;<small> And you mentioned me! Woot!!</small>

About This Instructable




More by Jayefuu:Beech Tray for Salt & Pepper Mill Omas Grünes Tomaten Chutney Disabling Contactless Payment on Debit Cards 
Add instructable to: