This is an old revision of the document!


siroky_vtip.jpg

$ cat pismenka1.txt | iconv -f utf8 -t ascii//TRANSLIT//IGNO                                                                                       RE > ascii.txt
  • transform Czech and other diacritics to pure ascii
$ echo "whatever" | rev
  • result: revetahw
curl -u tpetru@gmail.com --silent "https://mail.google.com/mail/feed/atom" | perl -ne 'print "\t" if /<name>/; print "$2\n" if /<(title|name)>(.*)<\/\1>/;' > ~/tmp

Enter host password for user 'tpetru@gmail.com':
	Gmail - Inbox for tpetru@gmail.com</title><tagline>New messages in your Gmail Inbox</tagline><fullcount>3</fullcount><link rel="alternate" href="https://mail.google.com/mail" type="text/html" /><modified>2016-04-25T01:48:53Z</modified><entry><title>Tomas, discover eBay!</title><summary>Find all your favorites for less View this message in your browser. Fashion Electronics Home &amp;</summary><link rel="alternate" href="https://mail.google.com/mail?account_id=tpetru@gmail.com&amp;message_id=15447efa344aaff3&amp;view=conv&amp;extsrc=atom" type="text/html" /><modified>2016-04-24T11:02:47Z</modified><issued>2016-04-24T11:02:47Z</issued><id>tag:gmail.google.com,2004:1532489386297044979</id><author><name>eBay</name><email>eBay@reply1.ebay.com</email></author></entry><entry><title>CTJB 2016 (1-4.9.2016) Vysocina</title><summary>Caute hekre! Dalsi rocnik CTJB je tu! Bude sa konat 1.9.2016 - 4.9.2016 v malebnom prostredi Vysociny</summary><link rel="alternate" href="https://mail.google.com/mail?account_id=tpetru@gmail.com&amp;message_id=154443bd1c8ece1e&amp;view=conv&amp;extsrc=atom" type="text/html" /><modified>2016-04-23T17:47:31Z</modified><issued>2016-04-23T17:47:31Z</issued><id>tag:gmail.google.com,2004:1532424252719812126</id><author><name>Pavol Rusnak</name><email>stick@gk2.sk</email></author></entry><entry><title>public ip

cat ~/tmp | awk -v FS="(<fullcount>|</fullcount>)" '{print $2}'
  • get me emails from gmail
  • parse only number of new emails there

Tools

  • project/linuxfun.1461549487.txt.gz
  • Last modified: 2016/04/25 03:58
  • by over23