Skip to content

Instantly share code, notes, and snippets.

@nemanjan00
Created May 20, 2020 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemanjan00/07bc9de4fa2c34699b4f5a6509a93113 to your computer and use it in GitHub Desktop.
Save nemanjan00/07bc9de4fa2c34699b4f5a6509a93113 to your computer and use it in GitHub Desktop.
paket () {
curl "https://www.posta.rs/cir/alati/pracenje-posiljke.aspx?broj=$1" -H 'Connection: keep-alive' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36' -H 'Sec-Fetch-Mode: navigate' -H 'Sec-Fetch-User: ?1' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3' -H 'Sec-Fetch-Site: same-origin' -H 'Accept-Language: en-US,en;q=0.9' -H 'DNT: 1' -H 'Accept-Encoding: gzip, deflate, br' --compressed 2>/dev/null | grep " <td>" | tr -d '\t' | tr -s " " | head -n1 | sed 's$</td><td>$ $g' | sed 's$<td>$$g' | sed 's$ &nbsp;</td>$$g'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment