Skip to content

Instantly share code, notes, and snippets.

#Create, update and blog post into a Confluence Wiki with Python. You'll have to
#provide the server and user credentials
import sys
from xmlrpclib import Server
user = "username"
passwd = "passwd"
serverurl = "https://server.example.com/rpc/xmlrpc"
spacekey = "demospace"
#Create a new issue in Jira from the Python XMLRPC interface. You'll have to
#provide the server and user credentials and match up your own fields
import sys
from xmlrpclib import Server
user = "username"
passwd = "passwd"
serverurl = "https://server.example.com/rpc/xmlrpc"
projectname = "demoproject"
@jmcmellen
jmcmellen / batchit.py
Created August 7, 2012 22:39
Template for scripting actions on files in a file system
import os
def main():
for root, dirs, files in os.walk("."):
for file in files:
full_file = os.path.abspath("{0}\\{1}".format(root, file))
if filter_it(filename=full_file):
process_it(filename=full_file)
print "Done"
@jmcmellen
jmcmellen / gist:3657339
Created September 6, 2012 15:25
Get open NOTAMS for locations
import requests
r = requests.post("https://pilotweb.nas.faa.gov/PilotWeb/notamRetrievalByICAOAction.do?method=displayByICAOs", params={"formatType":"DOMESTIC", "retrieveLocId":"eos\n3dw\nbbg", "reportType":"REPORT", "openItems":"", "actionType":"notamRetrievalByICAOs" })
print r.content
@jmcmellen
jmcmellen / file1.py
Created September 6, 2012 19:54
Post gist from ipython as myself with a token
print "Hello World"
@jmcmellen
jmcmellen / file1.py
Created September 17, 2012 20:20
Pasted from IPython
import coveapi
import ConfigParser
config = ConfigParser.SafeConfigParser(allow_no_value=True)
with open('covekeys.cfg') as cfg:
config.readfp(cfg)
print config.get('API_id')
print config.get('Main', 'API_id')
cove = coveapi.connect(config.get('Main', 'API_id'), config.get('Main', 'API_secret'))
thing = cove.videos.filter(filter_title__contains='Ozarks')
print thing
@jmcmellen
jmcmellen / file1.py
Created September 17, 2012 22:45
Pasted from IPython
import coveapi
import ConfigParser
config = ConfigParser.SafeConfigParser(allow_no_value=True)
with open('covekeys.cfg') as cfg:
config.readfp(cfg)
cove = coveapi.connect(config.get("Main", "API_id'), config.get("Main", "API_secret"))
cove = coveapi.connect(config.get("Main", "API_id'), config.get("Main", "API_secret"))
cove = coveapi.connect(config.get("Main", "API_id"), config.get("Main", "API_secret"))
cove
Hello from Vim!
Hello from Vim!
Thank you @mattn!
Gist-vim is awesome!
@jmcmellen
jmcmellen / file1.py
Created October 19, 2012 21:24
Pasted from IPython
import coveapi
import ConfigParser
config = ConfigParser.SafeConfigParser(allow_no_value=True)
with open('covekeys.cfg') as cfg:
config.readfp(cfg)
cove = coveapi.connect(config.get("Main", "API_id"), config.get("Main", "API_secret"))
cove.programs
cove.programs.filter(filter_nola_root="KOZK")