Skip to content

Instantly share code, notes, and snippets.

Kyle Mahan kylewm

Block or report user

Report or block kylewm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
import requests
from bs4 import BeautifulSoup
from urllib.parse import urlencode, parse_qs
def get_endpoints(url):
r = requests.get(url)
soup = BeautifulSoup(r.text)
kylewm / tld-regex.txt
Created Jan 28, 2016
Regex matching all TLDs
View tld-regex.txt
View gist:89fe76aeb6e32af8146b
>>> from bs4 import BeautifulSoup
>>> import requests
>>> soup = BeautifulSoup(requests.get('').text)
>>> soup.body.div.find_all()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/srv/www/", line 1180, in find_all
return self._find_all(name, attrs, text, limit, generator, **kwargs)
File "/srv/www/", line 491, in _find_all
return ResultSet(strainer, result)
kylewm / reply.js
Created Apr 9, 2015
Tweet-aware reply bookmarklet
View reply.js
var url=window.location;
var openedTweet=document.querySelector('.opened-tweet');
kylewm / gist:451c59261e3a749b0536
Last active Aug 29, 2015
Nginx configuration for Websockets
View gist:451c59261e3a749b0536
location /_updates {
proxy_pass http://localhost:8077;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400s;
kylewm /
Last active Aug 29, 2015
bridgy stackoverflow question

Facebook Graph API: Find graph object from post URL

Given the URL of a public Facebook post, how can one find the post object in the FB Graph API?

We would like to be able to comment on or like a post via the v2.x Graph API, given the post's URL. Doing so requires the post's object ID, which we can make some educated guesses about, but accessing the actual object through the API has proven unreliable (works for some posts but not others).

kylewm / nginx-configuration
Created Dec 20, 2014
View nginx-configuration
proxy_cache_path /srv/www/ keys_zone=one:10m max_size=500m;
server {
listen 443 ssl;
kylewm / known-nginx-config
Last active Apr 19, 2017
my Known configuration for nginx
View known-nginx-config
server {
listen 80;
root /home/vagrant/idno;
index index.php;
location ~ (\.ini|known.php)$ {
deny all;
kylewm / indie-config.js
Last active Aug 29, 2015
Loads indie-config and if available, apply handlers to <indie-action> tags
View indie-config.js
// Lazy-create and return an indie-config load promise
// The promise will be resolved with a config once the indie-config has been loaded
var loadIndieConfig = function () {
// Create the Promise to return
var loadPromise = new Promise(function (resolve) {
// Parse the incoming messages
var parseIndieConfig = function (message) {

Keybase proof

I hereby claim:

  • I am kylewm on github.
  • I am kylewm ( on keybase.
  • I have a public key whose fingerprint is D718 74E3 40FB 85B1 21BE 04E6 03AA A9DA C3F7 73CB

To claim this, I am signing this object:

You can’t perform that action at this time.