In [67]:
import markdown
In [68]:
import requests
import json
import xmltodict
In [76]:
hcpux = requests.get('http://feeds.feedburner.com/HamiltonComputerClub?format=xml')
In [77]:
cerz = hcpux.text
In [77]:
In [78]:
hamx = xmltodict.parse(cerz)
In [79]:
for ha in hamx['rss']['channel']:
print ha
In [92]:
staz = hamx['rss']['channel']
In [93]:
alket = staz.keys()
In [94]:
len(alket)
Out[94]:
In [95]:
savlis = []
In [96]:
print alket[3]
In [97]:
savcal = staz.values
In [ ]:
In [98]:
savcal()[0:7]
Out[98]:
In [87]:
for ket in alket:
#print staz[ket]
print staz['title']
savlis.append(staz[ket])
In [88]:
opd = json.dumps(hamxy)
In [89]:
savopd = open('cpuclu.json', 'w')
In [90]:
savopd.write(opd)
In [ ]:
savopd.close()
In [ ]:
zopa = open('cpuclu.json', 'r')
In [ ]:
print zopa.read()
In [ ]:
myjson = zopa.read()
In [ ]:
sjson = json.dumps(hamx)
In [ ]:
print sjson
In [ ]:
cerz
In [ ]:
markdown.to_html_string('*testing one two three*')
In [ ]:
html = markdown.markdown('testing123!')
In [ ]:
print html
In [70]:
import os
In [71]:
posfol = ("/home/will/hamiiltoncomputerclub.org.nz/static/posts")
blotil = ("wcmckee")
In [72]:
os.makedirs(posfol)
In [72]:
In [73]:
ls
In [74]:
rstz = open((blotil + '.rst'), 'w')
In [75]:
rstz.write('
In [ ]:
In [ ]:
conv = markdown.markdownFromFile
In [ ]:
import pandoc
In [ ]:
pandoc.PANDOC_PATH = ('/usr/bin/pandoc')
In [ ]:
panout = pandoc.Document.OUTPUT_FORMATS
In [ ]:
for pa in panout:
print pa
In [ ]:
panin = pandoc.Document.INPUT_FORMATS
In [ ]:
panin
In [ ]:
for nai in panin:
print nai
In [ ]:
nai
In [ ]:
doc = pandoc.Document()
doc.markdown = '''
# I am a tag
*omg this is a test!
[artcontrol](https://artcontrol.me)
'''
In [ ]:
print doc.html
In [ ]: