notes/Fake Caller ID Dialer for the N900-YEgpL5gk.py
#!/usr/bin/env python


import gtk, urllib, dbus

mynumber="5555555555"
callnum="0"
fakenum="0"

def press(widget):
	num = entry.get_text()
	pnum = widget.get_label()
	entry.set_text(num + pnum)

def make_call(number):
	bus = dbus.SystemBus()
	csd_call = dbus.Interface(bus.get_object('com.nokia.csd',
                                       	'/com/nokia/csd/call'),
                                       	'com.nokia.csd.Call')
	csd_call.CreateWith(str(number), dbus.UInt32(0))

def send_press(widget):
	global callnum, fakenum, mynumber
	print "Calling: " + callnum
	print "Fake Number: " + fakenum
	f = urllib.urlopen("http://calleridfaker.com/api/freecall/?my_phoneno=i" + mynumber + "&phoneno=" + callnum + "&cid=" + fakenum + "&voicerad=woman&voice=normal&record=no-record&email=&terms=on")

	s = f.read()
	s = s.split("+")
	s = s[1]
	s = s.split('"')
	s = s[0]
	print s
	f.close()
	dial_label.set_label(s)
	make_call(s)
    
def add_call(widget):
	global callnum
	callnum=entry.get_text()
	entry.set_text("")

def add_fake(widget):
	global fakenum
	fakenum=entry.get_text()
	entry.set_text("")

win=gtk.Window()
win.connect('destroy', lambda w: gtk.main_quit())

box = gtk.VBox()
win.add(box)

dial_label=gtk.Label("")
box.pack_start(dial_label, False)

entry=gtk.Entry()
box.pack_start(entry, False)

table=gtk.Table(2, 2, gtk.TRUE)

a = [1,2,3,4,5,6,7,8,9,"#",0,"*"]
x = 0
y = 0

for i in a:
	button=gtk.Button(str(i))
	button.connect("clicked", press)
	table.attach(button,x,x+1,y,y+1)
	x+=1
	if x > 2:
    	x = 0
    	y+=1


box.pack_start(table)

box2=gtk.HBox()
box.pack_start(box2)

call_button=gtk.Button("Add Call#")
call_button.connect("clicked", add_call)
box2.pack_start(call_button)

fakebutton=gtk.Button("Add Fake#")
fakebutton.connect("clicked", add_fake)
box2.pack_start(fakebutton)

send=gtk.Button("SEND")
send.connect("clicked", send_press)
box2.pack_start(send)

win.show_all()

gtk.main()

syntax highlighted by Code2HTML, v. 0.9.1