2012, June 12 (Tue) | |
Linux – plugwork in textmode | |
---|---|
I want to show how certain tasks can be automated easily step by step using just a few tools. Today’s example will be about web automation. will be used, but any other language would do. To get things done, the important part is to choose the right ready-made components. For Perl, these can be found on the CPAN. When looking for modules, one has to be aware that there is both good and crap modules out there. Check the reverse dependencies, recent releases and maybe the ratings. A quick check on the search engine might also tell if the module is proven tech. For web automation, the module needed is WWW::Mechanize. Often it will already be packaged by your distribution so on Debians, install More to learn for SuSE users: For acquiring SuSE packages, the web interface on opensuse.org will find packages in the build service and provide one click install. Pro-tip for text mode: If you install the The work can begin. First you should know which site to automate. Often, it requires filling out of forms. Then, open the site in your web browser and open a terminal. WWW::Mechanize comes with a little tool to help us get started. Just type
there we have a possible form to fill out and can also peek at the hidden values. Nothing that the “View Source” button cannot do, but more convenient.
|
|
Continue reading “plugwork in textmode” » | |
2012, June 14 (Thu) | |
Linux – shell-work in plug-mode | |
Welcome to the second edition of automation and having fun in text-mode only. We will build a small monitoring system and integrate it with a shell script. Because POSIX sh is boring and the script doesn’t need to work on any limited platform, we will use shell So, the first line of the script is:
next, we call the program whose output should be monitored. The idea is that we want to get informed whenever there is a change in the output. Of course, you can fill in whatever criterion suits your needs here. The output is then stored to a temporary file:
the resulting output is compared to the output from last time the program was run, and if there is a change, notification should happen. the
note that so far this is a place-holder, nothing has been thought up as how to deliver the notification. That’s the next topic to finish off the script, we should store the newly recorded output as last output. Then, we wait a while before restarting the script for the next iteration
(first part: plugwork in textmode) |
|
Continue reading “shell-work in plug-mode” » | |
Navigation | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
« | (older) | (newer) | » | |||||||
« | March 2012 | « | Main | ‹ | All articles list (Archives) | › | Search | » | July 2012 | » |