Skip to content

Instantly share code, notes, and snippets.

@jthingelstad
jthingelstad / import-jsonfeed-microblog.py
Created May 2, 2020 13:17
Script to import a JSONFeed file and referenced images to micro.blog.
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import json
import pypandoc
import re
import requests
import os.path
import sys
import time
@jthingelstad
jthingelstad / jsonfeed.JSON
Created May 2, 2020 13:15
Jekyll template to create JSONFeed for all posts in site
---
layout: null
---
{
"version": "https://jsonfeed.org/version/1",
"title": {{ site.title | jsonify }},
"author": {
"name": {{ site.author | jsonify }},
"url": "{{ site.url }}{{ site.baseurl }}{% link about/index.md %}",
"avatar": "https://s.gravatar.com/avatar/54e9f4f6495f7b7a218ae7051a173645?s=500"
[
{
"section": "Get clear",
"intro": "Let's get started with the get clear phase of our review.",
"timer": 0,
"outro": ""
},
{
"section": "Collect loose papers and materials",
"intro": "Gather all accumulated business cards, receipts, and miscellaneous paper-based materials into your in-tray.",
@jthingelstad
jthingelstad / findapi.py
Created June 9, 2014 00:49
Some hack-y script I put together to try and find the API URL by calling a MediaWiki site and looking at the HTML.
#!/usr/bin/python
import requests
from BeautifulSoup import BeautifulSoup
from urlparse import urlparse
class FindAPI():
__api_list = open('output_api.txt', 'w')
@jthingelstad
jthingelstad / farm-wikkii.py
Created May 26, 2014 16:29
Original script that imported wikis from Wikkii
#!/usr/bin/python
"""
Pull configuration files from WikiMedia to update WikiApiary.
"""
import sys
import requests
from bs4 import BeautifulSoup
@jthingelstad
jthingelstad / farm-wikimedia.py
Created May 26, 2014 15:26
This is the v1 farmer that WikiApiary used to import Wikimedia wikis. It needs to be completely rewritten.
#!/usr/bin/python
"""
Pull configuration files from WikiMedia to update WikiApiary.
"""
import sys
import re
import requests
@jthingelstad
jthingelstad / farm-wikia.py
Created May 26, 2014 15:17
Quick Python script that iterates through Wikia's API to harvest the list of wikis. This is a good starter for https://github.com/thingles/WikiApiary/issues/50.
#!/usr/bin/python
"""
Pull the list of wikis that Wikia has.
"""
import requests
class Wikia():
"""Wikia class."""
### Keybase proof
I hereby claim:
* I am thingles on github.
* I am thingles (https://keybase.io/thingles) on keybase.
* I have a public key whose fingerprint is 1BB0 2594 9407 426B CC69 22A1 F605 FFEE EA54 0B5E
To claim this, I am signing this object: