Guest User

WolframAlpha bash API Scraper / used to get timespan for crypto challenge 20101008

a guest
Oct 12th, 2010
1,112
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # Israel Torres
  3. # Fri Sep 24 10:44:47 PDT 2010
  4. # WolframAlpha API Scraper / used to get timespan for crypto challenge 20101008 crypto.israeltorres.org
  5. # Updated Notes... just checked 10/12/2010 and verified this no longer works - WA has now blocked "sample" IDs...
  6. # running this now returns "1 Invalid appid" ... well played @wolfram_alpha ... well played [ 1 Invalid appid ] ;)
  7. # apparently this was a documented-undocumented-feature and has been patched appropriately ;p
  8. #
  9. ttotl=`curl -s 'http://api.wolframalpha.com/v1/query?input=from+Tue+Sep+14+19%3A00%3A21+PDT+2010+to+Fri+Oct+8+17%3A00+PDT+2010&appid=xxxxx' | grep plaintext -m 2 | sed 's/\<plaintext\>//g' | sed 's/\<\/plaintext\>//g' | grep -v \|`
  10. tleft=`curl -s 'http://api.wolframalpha.com/v1/query?input=now+to+Fri+Oct+8+17%3A00+PDT+2010&appid=xxxxx' | grep plaintext -m 2 | sed 's/\<plaintext\>//g' | sed 's/\<\/plaintext\>//g' | grep -v \|`
  11. telap=`curl -s 'http://api.wolframalpha.com/v1/query?input=from+Tue+Sep+14+19%3A00%3A21+PDT+2010+to+now&appid=xxxxx' | grep plaintext -m 2 | sed 's/\<plaintext\>//g' | sed 's/\<\/plaintext\>//g' | grep -v \|`
  12. echo -e "total time:\t$ttotl"
  13. echo -e "time remaining:\t$tleft"
  14. echo -e "time elapsed:\t$telap"
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×