International mirror patch via Michael Williams.

This patch is intended to make it easier for an international
arxiv mirror to be used. Technically this is already achievable
by fiddling with the adsmirrors list in the Python main script.
Perhaps I should introduce a user-editable config file?

Below is the e-mail message for the patch from M. Williams:

> I've noticed that is doesn't seem to respect the user's location when
> downloading PDFs from the arXiv. Like a lot of astronomers outside the
> US, I prefer to use arXiv and ADS mirrors outside the US. I use a non-US
> arXiv mirror because they serve up a PDF with A4 paper (rather than US
> letter). I use a non-US ADS mirror because their arXiv links direct to
> local arXiv mirrors (i.e. you get A4 paper!)
>
> Here's an example of an ADS article on a mirror
> http://esoads.eso.org/abs/2009arXiv0911.2260S. Note that in this case
> the arXiv link takes you to the local arXiv mirror (Germany in that
> case), where you can manually download an A4 PDF.
>
> However, the function getPDF() in the script constructs a PDF URL at the
> master http://arxiv.org mirror. It does this by parsing the HTML on the
> arXiv page the ADS page links to, looking for the dc:identifier link,
> which is also a link to the master http://arxiv.org mirror.
>
> I've implemented the following changes to getPDF() to parse the HTML to
> determine which arXiv mirror it has been redirect to from the <h1> link
> that starts each page, and to use that for the PDF too.
>
> This works for me for both the mirrors I've tested and the master sites
> -- on the master sites you end up with a US letter PDF, and on the
> mirrors you get an A4 PDF. I'm not a regexp or Python expert though, so
> I may be doing things in a fragile or hacky way. For example, perhaps
> there is a way to determine the arXiv URL the ADS link redirects to (and
> extract the mirror information from that), rather than scraping it from
> the HTML. Nevertheless, feel free to include it in the official ADS to
> Bibdesk service!
Added a readme file in markdown.
Rui Pereira's patch for preference file support.

Rui's notes:
- it uses a preferences file (~/.adsbibdesk), automatically created from a
  template if none is found
- currently the preferences you can set are the ADS and arXiv mirror, toggle
  to download PDFs, and the ssh info. Other things like proxies can be added
  later
- I adapted Mike's code patch so that if there is no arxiv_mirror defined in
  the preferences, it uses the automatic one selected by your ADS mirror, or
  else it uses explicitly the arxiv_mirror value
- it now works under Python 2.5 (I don't have a Leopard install to test it,
  but it should work fine)
Refactored the preferences dictionary as an object that wraps a dictionary.

The new Preferences object first create a prefs dictionary from harded
coded default. These are then overriden by a dictionary parsed from
the user configuration file. If no user config file is detected, one
is written to disk.

Also starting to use optparse to allow command line arguments for
debugging and testing. For example, -d will turn on debugging in
the Preferences object. This can by used in the html parser objects
for printing debug messages that shouldn't (and can't) be printed
during normal operation as an automator action.
Detect ADS abstract page url with 'url.netloc in prefs.adsmirrors' now.

Per the suggestion of Mike Williams.
Merge branch 'intl_mirrors' into work
Added icon from Dan Foreman-Mackey (Queen's U) for the app version.
Whitespace cleanup and propagate DefaultPrefs into the default preferences file.
Minor bugs and cosmetic fixes.
Cosmetic fixes.
Added build.py script to automatically embed the current python and applescript scripts into the Automator workflow.
Small regex fix.
Added App version of the workflow.
Merge pull request #1 from RuiPereira/work

Merge Rui's work for v3 release.

Includes build.py script to maintain automator workflows,
and propagation of DefaultPrefs into the default preferences.
Fixed bug in usage of default Preferences.
Check for the need of HTTP authentication when downloading PDFs.
Renamed applescript file and tiny change in first author identification.
Script for updating ArXiv entries in BibDesk with the most recent ADS bibcode.
Merge pull request #2 from RuiPereira/work

Further bug fixes before v2.1
adsbibdesk.py: skip article if ads.bibtex is None

I get ads.bibtex == None on rare occasions. One example is
http://adsabs.harvard.edu/abs/2007astro.ph..2173B
The problem seems to be that ADSHTMLParser.parse() doesn't always
find a bibtex link.

Also added debug print statements, and put update_bibdesk_arxiv.sh
to run adsbibdesk.py in debug mode for the moment.
update_bibdesk_arxiv.sh: added 5 minute delay between paper downloads

ADS servers appear to block clients that agressively download
(such as this script). The 5 minute delay is an experimental
attempt at throttling the download pace.

Shorter delays might be amenable. I will contact ADS to advice.
Strip down the number of ADS calls by reusing opened urllib streams. Added a 5s wait between calls for check of arXiv entries updates.
cPickle is useless for the compression mechanism.