15/11/2010

Free SMSes through Google Calendar by http://www.kryogenix.org

This is a simple python code  for send  sms from google calendar via gdata api

# Requires gdata.py-1.2.1 from http://code.google.com/p/gdata-python-client/
try:
from xml.etree import ElementTree
except ImportError:
from elementtree import ElementTree
import gdata.calendar.service
import gdata.service
import atom.service
import gdata.calendar
import atom
import base64
import time

def send_sms(message_text):
cal_client = gdata.calendar.service.CalendarService()
cal_client.email = "YOUR GOOGLE MAIL ACCOUNT"
cal_client.password = "YOUR GOOGLE MAIL PASSWORD"
cal_client.source = 'calendar-sms-misuse-1.0'
cal_client.ProgrammaticLogin()

event = gdata.calendar.CalendarEventEntry()
event.title = atom.Title(text=message_text)
event.content = atom.Content(text="")

# can't set SMS reminders for under 5 minutes, so set this to 6 mins from now
start_time = time.strftime('%Y-%m-%dT%H:%M:%S.000Z', time.gmtime(time.time()+(6*60)))
end_time = time.strftime('%Y-%m-%dT%H:%M:%S.000Z', time.gmtime(time.time() + 3600))
when = gdata.calendar.When(start_time=start_time, end_time=end_time)
# can't set SMS reminders for under 5 minutes, so set this to 5
reminder = gdata.calendar.Reminder(minutes=5, extension_attributes={"method":"sms"})
when.reminder.append(reminder)
event.when.append(when)

cal_client.InsertEvent(event, '/calendar/feeds/default/private/full')


send_sms("Message body")

Original Post
http://www.kryogenix.org/days/2008/10/15/free-smses-through-google-calendar



5 comments:

  1. It seems to me that for such purposes it will be much easier to use this service www.intistele.com/solutions/marketers Because it allows you not to use Google calendars, which is much more convenient. I have already tried it and now may safely recommend it.

    ReplyDelete
  2. Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. Buy Google Places Reviews,

    ReplyDelete
  3. You wouldn't be the first one who retires thanks to the Internet. How To Make Money Using Opinion Square

    ReplyDelete
  4. Super-Duper site! I am Loving it!! Will come back again, Im taking your feed also, Thanks. receive SMS free

    ReplyDelete
  5. Rolling machines are helpful in forming steel into rolls, thereby creating a extra completed product. Oxy-acetylene torches are additionally utilized in straightening warped steel in sheet metal fabrication by making use travel underwear of the warmth slowly and linearly. In blanking, the most highly effective of the three processes, a gap punch is used to chop out holes within the sheet.

    ReplyDelete