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
# Given a URL, return string of lowercase text from page. | |
def webPageToText(url): | |
import urllib2 | |
response = urllib2.urlopen(url) | |
html = response.read() | |
text = stripTags(html).lower() | |
return text |
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 requests as req | |
import simplejson as json | |
BASE_URL = "https://mandrillapp.com/api/1.0/" | |
MANDRILL_API_KEY = "lol-yeah" | |
def send(to, message, subject="Just Testing Mandrill"): | |
url = BASE_URL + "messages/send.json" | |
data = { |
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
# Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail | |
# Make sure you have IMAP enabled in your gmail settings. | |
# Right now it won't download same file name twice even if their contents are different. | |
import email | |
import getpass, imaplib | |
import os | |
import sys | |
detach_dir = '.' |
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 sys | |
try: | |
import eventlet | |
sys.modules['httplib2'] = eventlet.import_patched('httplib2') | |
print "[Optional Import] Using eventlet" | |
except Exception: | |
print "[Optional Import] Not using eventlet" | |
from semantics3 import Semantics3Request | |
from semantics3 import Products | |
from semantics3 import Categories |
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 ebaysdk | |
from ebaysdk import finding | |
api = finding(siteid='EBAY-GB', appid='<REPLACE WITH YOUR OWN APPID>') | |
api.execute('findItemsAdvanced', { | |
'keywords': 'laptop', | |
'categoryId' : ['177', '111422'], | |
'itemFilter': [ | |
{'name': 'Condition', 'value': 'Used'}, |
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
""" | |
This is an example of requesting a report through LMS, in this case we're | |
requesting an ActiveInvenotryReport. | |
NOTE: This code is completely untested at this point, but it should work. | |
""" | |
import uuid | |
import lmslib |
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 python | |
# | |
# Very basic example of using Python and IMAP to iterate over emails in a | |
# gmail folder/label. This code is released into the public domain. | |
# | |
# RKI July 2013 | |
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/ | |
# | |
import sys | |
import imaplib |
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 python | |
EBAY_APP_ID = '' | |
EBAY_DEV_ID = '' | |
EBAY_CER_ID = '' | |
EBAY_USER_TOKEN = '' | |
EBAY_CATEGORIES = [ | |
31388, # Digital Cameras | |
11724, # Camcorders |
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/python | |
import imaplib | |
import csv | |
from email import message_from_string | |
import time | |
srv = imaplib.IMAP4_SSL("imap.gmail.com") | |
srv.login('[email protected]', 'joepw') | |
srv.select('[Gmail]/Drafts') |
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 sys, csv, BeautifulSoup | |
from ebaysdk import finding | |
import pandas as pd | |
import sklearn | |
import cgi, cgitb | |
import matplotlib.pyplotlib as plt | |
import MySQLdb | |
#form = cgi.FieldStorage() | |
OlderNewer