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: http://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.
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 like it! <a href="http://www.arceyazilim.com" rel="nofollow">web sitesi</a>
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.
its that needed?<br>
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="http://www.instructables.com/member/Jayefuu/statscard">http://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.
Welcome to browse
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


33 favorites


More by Jayefuu: Omas Grünes Tomaten Chutney Disabling Contactless Payment on Debit Cards Styrene LED Strip Brackets
Add instructable to: