Skip to content

Instantly share code, notes, and snippets.

@firedfox
Created July 8, 2013 07:22
Show Gist options
  • Save firedfox/5946828 to your computer and use it in GitHub Desktop.
Save firedfox/5946828 to your computer and use it in GitHub Desktop.
#!/bin/sh
url=$1;
hmurl=`curl -s $url | grep -o 'hm.baidu.com/hm\?.js\(%3F\|?\)[0-9a-z]\{32\}'`;
hmjs=`curl -s 'http://'$(echo $hmurl | sed "s/%3F/\?/") -H "Referer:$url"`;
siteid=`echo $hmjs | grep -oP '(?<=id:")\w+'`;
plan=`echo $hmjs | grep -oP '(?<=rp:)[0-9]*'`;
curl -s "http://crs.baidu.com/t.js?siteId=$siteid&planId=$plan" -H "Referer:$url" | grep -oP '(?<=rc:\[)[^]]*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment