Skip to content

Instantly share code, notes, and snippets.

View clintmjohnson's full-sized avatar

Clint Johnson clintmjohnson

View GitHub Profile
@wrhansen
wrhansen / gist:7199402
Created October 28, 2013 15:54
Try this for downloading an ActiveInventoryReport using lmslib
"""
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
@davidtsadler
davidtsadler / finding.py
Last active February 19, 2024 03:06
A very simple example showing how to make an eBay Finding API request with the ebaysdk-python (https://github.com/timotheus/ebaysdk-python). The example will do a keyword search for 'laptops' across the UK eBay site and restrict the search to the two categories Apple Laptops(111422) and PC Laptops & Netbooks(177). In addition the results are fil…
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'},
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
# 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 = '.'
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 = {
@acrymble
acrymble / webpage-to-text.py
Created July 5, 2011 19:49
Python Webpage to Text
# 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