The renewal maintenance has officially ended for Progress iMacros effective November 30, 2023.
This Wiki site will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely, The Progress Team
Difference between revisions of "Linux"
m (Text replacement - "http://www.iopus.com/imacros/compare" to "https://imacros.net/store/compare-versions/") |
|||
(36 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
= iMacros Scripting Interface for Linux = | = iMacros Scripting Interface for Linux = | ||
+ | |||
+ | '''Note: As of 2013/1/1 we no longer support or update the Linux version of the Scripting Interface''' | ||
+ | |||
+ | The Linux version of the Scripting Interface is '''free''' for all users of the [https://imacros.net/store/compare-versions//index.htm#player iMacros Unlimited Player License (US$ 399.00)]. Note that the Player (and thus iMacros for Linux) is included at no extra costs in all [https://imacros.net/store//#bundle iMacros Enterprise Bundles]. So for most use cases, we highly recommend our Enterprise Bundles. They contain all licenses you need at a great discount. | ||
+ | |||
+ | iMacros works fine on 32-bit and 64-bit systems. Just note that the iMacros Scripting Interface needs '''32bit''' Python, also on a x64 system. The reason is, Firefox and Chrome itself are 32bit applications. | ||
+ | |||
+ | Important: iMacros for Firefox 7.4.* contains bigger interface changes and is not yet supported with the Linux Scripting Interface. Please use [https://addons.mozilla.org/en-US/firefox/addon/imacros-for-firefox/versions/ iMacros for Firefox 7.3.x] along with [http://releases.mozilla.org/pub/mozilla.org/firefox/releases/ Firefox 6] or lower. This combination is tested and supported. | ||
== Download == | == Download == | ||
− | * '''=>''' [http:// | + | * '''=>''' [http://download.imacros.net/archive/imacros-linux-v1.00.zip Click here to download iMacros Scripting Interface for Linux V1.00] (ZIP-archive, released 2011/2/2) |
This download is a free trial. It shows a small registration reminder at start. | This download is a free trial. It shows a small registration reminder at start. | ||
Line 10: | Line 18: | ||
* Vice versa, if you already own an iMacros Player [[Linux#License|License]] for Windows then the Linux version is available at no extra cost for you. | * Vice versa, if you already own an iMacros Player [[Linux#License|License]] for Windows then the Linux version is available at no extra cost for you. | ||
+ | |||
+ | [[File:Imacros_linux.png|right]] | ||
== How to Set Up == | == How to Set Up == | ||
# Unzip the zipped archive, cd to extracted directory | # Unzip the zipped archive, cd to extracted directory | ||
− | # '''Install iMacros for Firefox add-on (''imacros.xpi'') V7.1.1. | + | # '''Install iMacros for Firefox add-on (''imacros.xpi'') V7.1.1.2 or later''' [http://wiki.imacros.net/iMacros_for_Firefox#Version_History Available only here, not yet on Mozilla Addons page] |
# Make sure that Python 2.6 is installed on your system | # Make sure that Python 2.6 is installed on your system | ||
# Either run python scripts from the extracted directory or modify your LD_LIBRARY_PATH environment variable | # Either run python scripts from the extracted directory or modify your LD_LIBRARY_PATH environment variable | ||
Line 22: | Line 32: | ||
import imacros | import imacros | ||
iret = imacros.iimInit("-fx", True) | iret = imacros.iimInit("-fx", True) | ||
− | iret = imacros.iimPlay("CODE:URL GOTO= | + | iret = imacros.iimPlay("CODE:URL GOTO=https://imacros.net") |
iret = imacros.iimExit() | iret = imacros.iimExit() | ||
− | Remember to use the [[iimInit|"-fxProfile"]] option if you want to run a lot of instances at once. This way cookies are not shared between instances. | + | Remember to use the [[iimInit#Separate_Browser_Instances|"-fxProfile"]] option if you want to run a lot of instances at once. This way cookies are not shared between instances. |
== Comprehensive Code Sample == | == Comprehensive Code Sample == | ||
Line 34: | Line 44: | ||
The package includes ''TCPClient.h'' file which defines scripting interface library API. See ''imacros.py'' for example. | The package includes ''TCPClient.h'' file which defines scripting interface library API. See ''imacros.py'' for example. | ||
− | == License == | + | For example, Ruby support: We found two Ruby libraries which can be used to call functions from shared libraries (i.e. dll). |
+ | |||
+ | First is [http://deathwarrior.wordpress.com/2006/11/06/using-shared-libraries-with-ruby/ dl] - quite familiar naming and plain interface. | ||
+ | |||
+ | Second is [http://blog.headius.com/2008/10/ffi-for-ruby-now-available.html ffi] - this looks more modern and preferred way. | ||
+ | |||
+ | If you create samples for Ruby, PHP or any other language, please email them to [https://imacros.net/support/ support] and we will publish them there. You can also post it in our [https://forum.imacros.net/viewforum.php?f=25 forum]. | ||
+ | |||
+ | == License Key == | ||
+ | |||
+ | The license is '''free''' for all users of the [https://imacros.net/store/compare-versions//index.htm#player iMacros Unlimited Player License (US$ 399.00)]. Note that the Player is included at no extra costs in all [https://imacros.net/store//#bundle iMacros Enterprise Bundles]. Please email [https://imacros.net/contact/ sales] with your Player license key (it starts with "KD....."), and we send you a special key for the Linux version (your Windows license key will not work). | ||
+ | |||
+ | == Scheduling iMacros Using Cron == | ||
+ | |||
+ | The main difficulty when trying to schedule scripts (that use iMacros) is that the Scripting Interface won't find your license key, even if you have already entered it before. | ||
+ | In order to solve that issue, we will create a "wrapper" for starting the script which feeds the license key to the Scripting Interface every time the wrapper is called. Additionally, the wrapper can be used to keep the cron entry short. | ||
+ | |||
+ | === Prerequisites === | ||
+ | In the following we assume that you have | ||
+ | # installed the iMacros for Firefox plugin | ||
+ | # downloaded and extracted the iMacros for Linux Scripting Interface to some folder we'll call ''/home/name/iMacrosLinux'', here | ||
+ | # created a minimal sample script ''/home/name/iMacrosLinux/minimal.py'': | ||
+ | |||
+ | #!/usr/bin/python | ||
+ | import imacros | ||
+ | iret = imacros.iimInit("-fx", True) | ||
+ | iret = imacros.iimPlay<nowiki>("CODE:URL GOTO=https://imacros.net")</nowiki> | ||
+ | iret = imacros.iimExit() | ||
+ | |||
+ | Make sure the sample script works when called from the command line: | ||
+ | /home/name/iMacrosLinux/minimal.py | ||
+ | |||
+ | === Preparing cron === | ||
+ | Add an entry to your crontab with | ||
+ | crontab -e | ||
+ | that looks like this | ||
+ | # m h dom mon dow command | ||
+ | # * * * * * /home/name/iMacrosLinux/cron.sh >> /home/name/iMacrosLinux/cron.log 2>&1 | ||
+ | This way, cron will call a helper script ''cron.sh'' every minute (adjust if necessary) and redirect standard output as well as standard error to a file ''cron.log''. | ||
+ | As we do not yet have the wrapper in place, the task is disabled/commented out. | ||
+ | |||
+ | === Watch the logs === | ||
+ | In order to "see what happens" (especially in case of error), you may want to open two terminals. One that watches ''/var/log/syslog'' for information about cron and another that watches our script's log: | ||
+ | tail -f /var/log/syslog | ||
+ | |||
+ | tail -f /home/name/iMacrosLinux/cron.log | ||
+ | |||
+ | === Create the wrapper === | ||
+ | Create a wrapper file ''/home/name/iMacrosLinux/cron.sh'' with the following content (explanation inside): | ||
+ | |||
+ | #!/bin/bash | ||
+ | |||
+ | # The macro will run in Firefox, so we need to determine | ||
+ | # what screen to use | ||
+ | export DISPLAY=:0 | ||
+ | |||
+ | # The iMacros Scripting Interface binaries reside in | ||
+ | # /home/name/iMacrosLinux, so we chage to that directory | ||
+ | # before running the script | ||
+ | cd /home/name/iMacrosLinux | ||
+ | |||
+ | # If you want to skip entering the license key, uncomment the | ||
+ | # following line that enters "c" when asked for the license key. | ||
+ | # The comment out everything below. | ||
+ | #/home/name/iMacrosLinux/minimal.py <<<'c' | ||
+ | |||
+ | # Call the script and enter the license key when the | ||
+ | # Scripting Interface asks for it | ||
+ | # | ||
+ | # IMPORTANT: Note the 'r' in front of the key. It tells the | ||
+ | # Scripting Interface that we want to enter the license. So if | ||
+ | # the license were '1234', that line would read 'r1234'. | ||
+ | /home/name/iMacrosLinux/minimal.py << EOF | ||
+ | rHERE_COMES_THE_KEY | ||
+ | EOF | ||
− | + | === Activate the cron entry === | |
+ | # Remove the leading '#' from the cron entry | ||
+ | # Wait for cron to trigger the wrapper | ||
+ | # Have an eye on the consoles that watch syslog and the script's ''cron.log'' | ||
== Known limitations == | == Known limitations == | ||
* No support for iMacros for Chrome, yet | * No support for iMacros for Chrome, yet | ||
* No 64bit support, yet | * No 64bit support, yet | ||
+ | * [https://forum.imacros.net/viewtopic.php?f=11&t=10828#p37060 DirectScreen and Image Recognition are not yet supported.] | ||
+ | |||
+ | == Distro-Specific Info == | ||
+ | |||
+ | === Ubuntu 10.10 === | ||
+ | * Works "out-of-the-box". | ||
+ | * No extra packages needed. | ||
+ | * Just perform the setup as described [http://wiki.imacros.net/Linux#How_to_Set_Up above]. | ||
+ | |||
+ | === Debian 6.0 "Squeeze" === | ||
+ | * No extra libraries needed. | ||
+ | * In case of a minimal setup, add "iceweasel", "unzip", "xorg" and "fluxbox" (or the like) | ||
+ | * Perform setup as described [http://wiki.imacros.net/Linux#How_to_Set_Up above]. | ||
+ | |||
+ | === Fedora 14 === | ||
+ | * Works "out-of-the-box" | ||
+ | * No extra packages needed. | ||
+ | * Just perform the setup as described [http://wiki.imacros.net/Linux#How_to_Set_Up above]. | ||
+ | |||
+ | === openSUSE 11.3 (Gnome) === | ||
+ | * Works "out-of-the-box" | ||
+ | * No extra packages needed. | ||
+ | * Just perform the setup as described [http://wiki.imacros.net/Linux#How_to_Set_Up above]. | ||
+ | |||
+ | === Sabayon 5.4 (Gnome) === | ||
+ | * Works "out-of-the-box" | ||
+ | * No extra packages needed. | ||
+ | * Just perform the setup as described [http://wiki.imacros.net/Linux#How_to_Set_Up above]. | ||
+ | |||
+ | == See Also == | ||
+ | |||
+ | [[iMacros for Firefox]], [[iMacros for Chrome]], [[Mac]] |
Latest revision as of 10:06, 21 November 2018
iMacros Scripting Interface for Linux
Note: As of 2013/1/1 we no longer support or update the Linux version of the Scripting Interface
The Linux version of the Scripting Interface is free for all users of the iMacros Unlimited Player License (US$ 399.00). Note that the Player (and thus iMacros for Linux) is included at no extra costs in all iMacros Enterprise Bundles. So for most use cases, we highly recommend our Enterprise Bundles. They contain all licenses you need at a great discount.
iMacros works fine on 32-bit and 64-bit systems. Just note that the iMacros Scripting Interface needs 32bit Python, also on a x64 system. The reason is, Firefox and Chrome itself are 32bit applications.
Important: iMacros for Firefox 7.4.* contains bigger interface changes and is not yet supported with the Linux Scripting Interface. Please use iMacros for Firefox 7.3.x along with Firefox 6 or lower. This combination is tested and supported.
Download
- => Click here to download iMacros Scripting Interface for Linux V1.00 (ZIP-archive, released 2011/2/2)
This download is a free trial. It shows a small registration reminder at start.
- Buy iMacros for Linux: You can purchase iMacros for Linux here. It includes the iMacros Player for Windows at no extra cost.
- Vice versa, if you already own an iMacros Player License for Windows then the Linux version is available at no extra cost for you.
How to Set Up
- Unzip the zipped archive, cd to extracted directory
- Install iMacros for Firefox add-on (imacros.xpi) V7.1.1.2 or later Available only here, not yet on Mozilla Addons page
- Make sure that Python 2.6 is installed on your system
- Either run python scripts from the extracted directory or modify your LD_LIBRARY_PATH environment variable
How to Test
Run minimal example
#!/usr/bin/python import imacros iret = imacros.iimInit("-fx", True) iret = imacros.iimPlay("CODE:URL GOTO=https://imacros.net") iret = imacros.iimExit()
Remember to use the "-fxProfile" option if you want to run a lot of instances at once. This way cookies are not shared between instances.
Comprehensive Code Sample
Have a look at example.py (note: this needs demo macros Demo-*.iim installed in the iMacros macro directory; default location is $HOME/iMacros/Macros/)
Bindings to other languages
The package includes TCPClient.h file which defines scripting interface library API. See imacros.py for example.
For example, Ruby support: We found two Ruby libraries which can be used to call functions from shared libraries (i.e. dll).
First is dl - quite familiar naming and plain interface.
Second is ffi - this looks more modern and preferred way.
If you create samples for Ruby, PHP or any other language, please email them to support and we will publish them there. You can also post it in our forum.
License Key
The license is free for all users of the iMacros Unlimited Player License (US$ 399.00). Note that the Player is included at no extra costs in all iMacros Enterprise Bundles. Please email sales with your Player license key (it starts with "KD....."), and we send you a special key for the Linux version (your Windows license key will not work).
Scheduling iMacros Using Cron
The main difficulty when trying to schedule scripts (that use iMacros) is that the Scripting Interface won't find your license key, even if you have already entered it before. In order to solve that issue, we will create a "wrapper" for starting the script which feeds the license key to the Scripting Interface every time the wrapper is called. Additionally, the wrapper can be used to keep the cron entry short.
Prerequisites
In the following we assume that you have
- installed the iMacros for Firefox plugin
- downloaded and extracted the iMacros for Linux Scripting Interface to some folder we'll call /home/name/iMacrosLinux, here
- created a minimal sample script /home/name/iMacrosLinux/minimal.py:
#!/usr/bin/python import imacros iret = imacros.iimInit("-fx", True) iret = imacros.iimPlay("CODE:URL GOTO=https://imacros.net") iret = imacros.iimExit()
Make sure the sample script works when called from the command line:
/home/name/iMacrosLinux/minimal.py
Preparing cron
Add an entry to your crontab with
crontab -e
that looks like this
# m h dom mon dow command # * * * * * /home/name/iMacrosLinux/cron.sh >> /home/name/iMacrosLinux/cron.log 2>&1
This way, cron will call a helper script cron.sh every minute (adjust if necessary) and redirect standard output as well as standard error to a file cron.log. As we do not yet have the wrapper in place, the task is disabled/commented out.
Watch the logs
In order to "see what happens" (especially in case of error), you may want to open two terminals. One that watches /var/log/syslog for information about cron and another that watches our script's log:
tail -f /var/log/syslog
tail -f /home/name/iMacrosLinux/cron.log
Create the wrapper
Create a wrapper file /home/name/iMacrosLinux/cron.sh with the following content (explanation inside):
#!/bin/bash # The macro will run in Firefox, so we need to determine # what screen to use export DISPLAY=:0 # The iMacros Scripting Interface binaries reside in # /home/name/iMacrosLinux, so we chage to that directory # before running the script cd /home/name/iMacrosLinux # If you want to skip entering the license key, uncomment the # following line that enters "c" when asked for the license key. # The comment out everything below. #/home/name/iMacrosLinux/minimal.py <<<'c' # Call the script and enter the license key when the # Scripting Interface asks for it # # IMPORTANT: Note the 'r' in front of the key. It tells the # Scripting Interface that we want to enter the license. So if # the license were '1234', that line would read 'r1234'. /home/name/iMacrosLinux/minimal.py << EOF rHERE_COMES_THE_KEY EOF
Activate the cron entry
- Remove the leading '#' from the cron entry
- Wait for cron to trigger the wrapper
- Have an eye on the consoles that watch syslog and the script's cron.log
Known limitations
- No support for iMacros for Chrome, yet
- No 64bit support, yet
- DirectScreen and Image Recognition are not yet supported.
Distro-Specific Info
Ubuntu 10.10
- Works "out-of-the-box".
- No extra packages needed.
- Just perform the setup as described above.
Debian 6.0 "Squeeze"
- No extra libraries needed.
- In case of a minimal setup, add "iceweasel", "unzip", "xorg" and "fluxbox" (or the like)
- Perform setup as described above.
Fedora 14
- Works "out-of-the-box"
- No extra packages needed.
- Just perform the setup as described above.
openSUSE 11.3 (Gnome)
- Works "out-of-the-box"
- No extra packages needed.
- Just perform the setup as described above.
Sabayon 5.4 (Gnome)
- Works "out-of-the-box"
- No extra packages needed.
- Just perform the setup as described above.