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)
gmjhowe.com/tutorials
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.
Remove these ads by
Signing UpStep 1: How it works
The code works in these steps:
- 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.
- 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
- The Instructables page constructed in step 2 is fetching using the PHP function curl() and stored in the variable $html.
- 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.
- 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.
- 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.
- 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.








































Visit Our Store »
Go Pro Today »




I banged up some of the code in other places on my site so need to go fix that...
Thank you so much for this!
If you do do it yourself this page will help:
http://www.instructables.com/member/Jayefuu/statscard
When's the next views count by the way? Not far from 1M now...
Any way to work around that?
I can't think of a way around that, sorry. You could have a static version, but that wouldn't be as fun :)
Works now, though :)
Thanks.
Care to add a link to your site here?
. And you mentioned me! Woot!!