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.

Super simple crontab example.

Super simple crontab example.
There comes a time when you want to let your computer be sort of a secretary and do jobs for you automatically at certain times, This instructable will help you do that,  Wanted  the computer to tell me when I was at 200,000 total views. The goal was to have a little popup tell when that happened. I could of been real fancy and have the computer send up a flag, turn on lights, or whatever. The pop- up was enough for me. We will be using cron to do all the work for us.

More info on cron at
\http://www.devdaily.com/linux/unix-linux-crontab-every-minute-hour-day-syntax

http://www.howconfig.com/linux/crontab/
 
Remove these adsRemove these ads by Signing Up
 

Step 1Get the info.

Get the info.
First we need to create a batch file to get the information from the web. We will be using  just a simple page scraping to get the total views. I have talked about page scraping before in other instructables. (i.e. http://www.instructables.com/id/Web-page-scraping-with-a-gui/ and others).

So you want to use your favorite edtitor (gedit, vim, nano, or etc) and  create k200.sh (or a name you prefer).

$ nano k200.sh

k200.sh
[code]
#=========================================================
# batch file to let me know when I get to 200,000 views.
username="computothought"
let goal=200000
let k200=$(elinks  www.instructables.com/member/$username/index.html | grep "Total Views" | sed 's/[^0-9]*//g')
# echo $k200
if [ $k200 -gt $goal ]; then
   zenity --info --text "Hip hip hooray, you hit 200,000 views." --display=:0.0
fi
[/code]

Then we need to make tce program execucable.

$ chmod +x k200.sh

So far so good.
« Previous StepDownload PDFView All StepsNext Step »

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.