Advertisement
Guest User

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

a guest
Sep 24th, 2010
1,897
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.89 KB | None | 0 0
  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. 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 \|`
  6. 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 \|`
  7. 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 \|`
  8. echo -e "total time:\t$ttotl"
  9. echo -e "time remaining:\t$tleft"
  10. echo -e "time elapsed:\t$telap"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement