diff options
author | Yaohan Chen <yaohan.chen@gmail.com> | 2015-04-16 20:37:15 -0400 |
---|---|---|
committer | Yaohan Chen <yaohan.chen@gmail.com> | 2015-04-16 20:37:15 -0400 |
commit | 13a1153d52347b769c71cdf0fdec37d91cc602af (patch) | |
tree | c9cdce75d8d43415364e36eff2c36920481db20c /discover-url.coffee | |
parent | 3b9be87188dc5dc1f1fcbe8e9a73d9f74546a050 (diff) | |
download | hib-dlagent-13a1153d52347b769c71cdf0fdec37d91cc602af.tar.gz hib-dlagent-13a1153d52347b769c71cdf0fdec37d91cc602af.zip |
Use humblebundle-python to work with HIB API
Diffstat (limited to 'discover-url.coffee')
-rw-r--r-- | discover-url.coffee | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/discover-url.coffee b/discover-url.coffee deleted file mode 100644 index bd64ffd..0000000 --- a/discover-url.coffee +++ /dev/null @@ -1,24 +0,0 @@ -system = require 'system' -[_, listing_page, filename, username] = system.args -password = system.env.PASSWORD -system.env.PASSWORD = '' - -util = require './util' -page = util.page - -util.log "Opening listing page..." -page.open listing_page, (status) -> - util.log "Opened listing page: #{status}" - util.handle_login_captcha -> - util.log 'Searching URLs...' - url = page.evaluate (filename) -> - # Characters in filename may need to be escaped for use in a selector - found = document.querySelector ".downloads.linux a[href*='#{filename}']" - found?.getAttribute('href') - , filename - util.log "Found URL: #{url}" - if url - system.stdout.writeLine url - phantom.exit() - , username, password - |