Created
May 26, 2011 12:31
-
-
Save maman/993040 to your computer and use it in GitHub Desktop.
Samurize python & ruby notification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import imaplib, re | |
conn = imaplib.IMAP4_SSL("imap.gmail.com", 993) | |
conn.login("#[email protected]#", "#yourpassword#") | |
unreadCount = re.search("UNSEEN (\d+)", conn.status("INBOX", "(UNSEEN)")[1][0]).group(1) | |
if unreadCount == "0": | |
unreadCount = "No" | |
print unreadCount + " New Mail" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'librmpd' | |
mpd = MPD.new '#address#', #port# | |
mpd.connect() | |
artist = mpd.current_song.artist | |
title = mpd.current_song.title | |
puts artist + "\n" + title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pywapi | |
import string | |
yahoo_result = pywapi.get_weather_from_yahoo('#yahooareacode#','metric') | |
print yahoo_result['condition']['temp'] + "C " + yahoo_result['condition']['text'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment