Skip to content

Instantly share code, notes, and snippets.

@mcskrzypczak
Created February 10, 2014 15:39
Show Gist options
  • Save mcskrzypczak/8918063 to your computer and use it in GitHub Desktop.
Save mcskrzypczak/8918063 to your computer and use it in GitHub Desktop.
Skrypt do tworzenia kopii zapasowej kontaktów na urządzeniach pod kontrolą iOS (wymagana instalacja aplikacji Pythonista)
import contacts
import webbrowser, urllib
DRAFTS_ACTION = "Kontakty"
VCARD = ""
people = contacts.get_all_people()
for person in people:
VCARD = VCARD + person.vcard
#print VCARD
base = "drafts://x-callback-url/create?text="
text = urllib.quote(VCARD, safe='')
action = "&action=" + urllib.quote(DRAFTS_ACTION, safe='')
success = "&x-success="
#print base + text + action + success
webbrowser.open(base + text + action + success)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment