Popular recipes tagged "meta:requires=mechanize" but not "web"http://code.activestate.com/recipes/tags/meta:requires=mechanize-web/2016-04-28T13:21:43-07:00ActiveState Code RecipesLibgen Epub Upload using Tor (Python)
2015-12-06T19:23:54-08:00fuji239http://code.activestate.com/recipes/users/4193238/http://code.activestate.com/recipes/579134-libgen-epub-upload-using-tor/
<p style="color: grey">
Python
recipe 579134
by <a href="/recipes/users/4193238/">fuji239</a>
(<a href="/recipes/tags/beautifulsoup/">beautifulsoup</a>, <a href="/recipes/tags/libgen/">libgen</a>, <a href="/recipes/tags/mechanize/">mechanize</a>, <a href="/recipes/tags/tor/">tor</a>, <a href="/recipes/tags/upload/">upload</a>).
Revision 2.
</p>
<p>This script shows how to upload epub files in Library Genesys (libgen) automatically by using Tor. Please note that only copyright free epubs should be used (such as those present in <a href="https://www.gutenberg.org/" rel="nofollow">https://www.gutenberg.org/</a>).
It will also check if MD5 hash is present before uploading.
This is provided for python educative purposes only : it shows how to use a Tor proxy, Mechanize (for uploading and form processing), Hashlib for MD5 calculation, Filemagic for mimetype detecting and BeautifulSoup for response analyzing, all together.</p>
Dropbox file uploader via web interface using Python with urllib2 and mechanize (Python)
2016-04-28T13:21:43-07:00ccpizzahttp://code.activestate.com/recipes/users/4170754/http://code.activestate.com/recipes/578030-dropbox-file-uploader-via-web-interface-using-pyth/
<p style="color: grey">
Python
recipe 578030
by <a href="/recipes/users/4170754/">ccpizza</a>
(<a href="/recipes/tags/dropbox/">dropbox</a>, <a href="/recipes/tags/mechanize/">mechanize</a>).
Revision 7.
</p>
<p>UPDATE:
This is script is not maintained and does not anymore with the current version of Dropbox. For a proper command line interface to dropbox I recommend <code>dropbox_uploader</code>: <a href="https://github.com/andreafabrizi/Dropbox-Uploader" rel="nofollow">https://github.com/andreafabrizi/Dropbox-Uploader</a></p>
<p>Originally inspired by the example at <a href="http://joncraton.org/blog/62/uploading-dropbox-python" rel="nofollow">http://joncraton.org/blog/62/uploading-dropbox-python</a>. </p>
<p>The script uses mechanize to logon to the web page and upload the file(s) to the Dropbox root folder or to the folder supplied on the command line as <code>dir:/my_dropbox_path</code> (if present, this must be the first parameter).</p>
<p>Multiple files and/or glob patterns names are accepted as script arguments.</p>
<h5 id="example-usage">Example usage</h5>
<pre class="prettyprint"><code>dropbox.py file1.txt # upload to root folder
dropbox.py dir:/Backups/2012 file1.txt # upload to custom folder
dropbox.py dir:/Backups/2012 *.txt # upload by file mask
dropbox.py dir:/Backups/2020 * # upload all files in current dir
</code></pre>
<p>Limitations: only files in current folder are processed, subfolders are ignored.</p>
<h5 id="note">NOTE</h5>
<p>The script requires the <code>mechanize</code> module - use <code>pip install mechanize</code> or <code>easy_install mechanize</code> to add it to your site-packages.</p>
<h5 id="note2">NOTE2</h5>
<p>I have found a cleaner way to manage dropbox files from the console - see the <em>dropbox-uploade</em>r script at <a href="https://github.com/andreafabrizi/Dropbox-Uploader" rel="nofollow">https://github.com/andreafabrizi/Dropbox-Uploader</a> - it is a Bash script that works using the official Dropbox API rather than emulating a web browser.</p>
SPOJ backup script (Python)
2010-02-09T08:50:44-08:00Shashwat Anandhttp://code.activestate.com/recipes/users/4172995/http://code.activestate.com/recipes/577036-spoj-backup-script/
<p style="color: grey">
Python
recipe 577036
by <a href="/recipes/users/4172995/">Shashwat Anand</a>
(<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/spoj/">spoj</a>, <a href="/recipes/tags/tools/">tools</a>).
Revision 3.
</p>
<h4>Introduction</h4>
<p>At Sphere Online Judge (<a href="http://www.spoj.pl" rel="nofollow">http://www.spoj.pl</a>) you are given the capability of trying out the
challenging problems given. It also gives you the capability of viewing
and downloading your own solution.</p>
<p>The tool spojbackup tends to automatically backup all your Accepted
submissions and save them on the desired location of your computer. The
basic idea is to automate the process which can be used as a backup and
an offline reference tool of your own codes.</p>
<h4>Features</h4>
<ul>
<li><p>Resume downloads.
spojbackup currently supports resuming of the solutions if internet
connection is disrupted</p></li>
<li><p>Incremental backup facility
it'll not download the code already present on your machine. Only newer
code added in your signedlist will be downloaded</p></li>
<li><p>User-defined destination
all codes are saved at user-defined destination
if no option is given by user it saves in the folder from where command is
run</p></li>
<li><p>Proxy support
Proxy support is provided as SPOJ users are generally university students
and they are generally behind a proxy and university firewall.</p></li>
</ul>
<h4>Bugs</h4>
<p>In case of finding a bug please drop a mail to the authors. We will try to sort
out the problems.</p>