3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Getting instructable counts.

Getting instructable counts.
Lets say you wanted to know how several instructables are doing. Did not take the time to make it with a gui. that is your homework. Just picked a few instructables from the first page as an example. You will want to create a data file with the urls or the web address of the instructables you have chosen. Right click on the links and copy link location and then paste it in your editor using the data file(Please see the prior instructables on page scraping if you have any questions).

idata: (Note: do not type in "[data]" or [/data] or you will get an error)
[data]
http://www.instructables.com/id/Program-an-ATtiny-with-Arduino/
http://www.instructables.com/id/Gut-Check-Fridge-a-Tweeting-and-Facebooking-Fri/
http://www.instructables.com/id/Air-quality-balloons/
http://www.instructables.com/id/Sun-Bottles/
http://www.instructables.com/id/Wrap-around-workbench-under-100/
http://www.instructables.com/id/Solar-PV-tracker/
[/data}

Then you need to create a program file to collect the data via web scraping. I did not go to the trouble to make it gui for simplicities sake.

iget.sh
[code]
#================================
#
# Instructablesnumbers catcher
#
#=================================
# Assignments
# --------------------------------
datafile="idata"
# the date
tmon=$(date +"%b")
tday=$(date +"%d")
echo "The views for $dj on $tmon $tday:"
#=================================
#
# Data input
#---------------------------------
while read line
do theurl=$line
# uncomment the following line if you want to see the url and or views
echo -n "$theurl"
# get total views
# elinks "$theurl" | grep "Total Views"
# get all the info
elinks "$theurl" | grep -m 2 Views
# just get numbers
# elinks "$theurl" | grep "Total Views" | cut -c 16-25
# Un remark the next line if you want it to be a bit more readable
# echo ""
done < $datafile
[/code]

Make it a program:
$ chmod +x iget.sh

Run it:
$ ./iget.sh
The views for on Oct 06:
http://www.instructables.com/id/Program-an-ATtiny-with-Arduino/
Total Views: 587
Today Views: 95
http://www.instructables.com/id/Gut-Check-Fridge-a-Tweeting-and-Facebooking-Fri/
Total Views: 618
Today Views: 608
http://www.instructables.com/id/Air-quality-balloons/
Total Views: 54,833
Today Views: 216
http://www.instructables.com/id/Sun-Bottles/
Total Views: 43,876
Today Views: 17
http://www.instructables.com/id/Wrap-around-workbench-under-100/
Total Views: 15,157
Today Views: 12
http://www.instructables.com/id/Solar-PV-tracker/
Total Views: 107,243
Today Views: 46
$ _

The following will save everything to a file if your want.
$ ./iget.sh >> datafile

A real time saver if you have many many instructables and do not want to go through each page to get the data. Follow up instructable: http://www.instructables.com/id/Getting-instructable-counts-continued/

Warning: Data may not be always up to date.

Note: MSWindows version:  http://www.instructables.com/id/Getting-instructable-counts-with-MSWindows/




2 comments
Oct 7, 2011. 3:40 PMsunshiine says:
Thanks for sharing all your hard work! This is valuable information! Have a splendorous day!
Sunshiine

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
66
Followers
203
Author:Computothought(Computothought)
Educator, technician, unchef, and chief bottle washer. Be sure to see http://www.instructables.com/community/Computhoughts/ for updates and status on projects.