Advertisement
METAJIJI

Untitled

May 19th, 2015
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. [ -z "$1" ] && echo 'Usage: !temp city_name' && exit 1
  4.  
  5. wget "https://p.ya.ru/$1" -qO - | awk '{
  6. match($0,/<span class="city [^>]*>(.*)<\/span>/,a)
  7. if(a[1]) {
  8. gsub("<[^>]*>", "", a[1]) # Strip html tags
  9. gsub("&[^;]*;", "", a[1]) # Strip html entities like as a &nbsp;
  10. print "В "a[1]
  11. }
  12. }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement