Skip to content

Instantly share code, notes, and snippets.

@fakedon
fakedon / gist:8c15a67a1a76dbb8eb4b3b83c3c1023f
Created June 8, 2021 17:51 — forked from simonw/gist:104413
Turn a BeautifulSoup form in to a dict of fields and default values - useful for screen scraping forms and then resubmitting them
def extract_form_fields(self, soup):
"Turn a BeautifulSoup form in to a dict of fields and default values"
fields = {}
for input in soup.findAll('input'):
# ignore submit/image with no name attribute
if input['type'] in ('submit', 'image') and not input.has_key('name'):
continue
# single element nome/value fields
if input['type'] in ('text', 'hidden', 'password', 'submit', 'image'):
@fakedon
fakedon / drive:v2internal.json
Created April 5, 2021 06:44 — forked from chocolatkey/drive:v2internal.json
No, I don't work at Google
{
"kind": "discovery#restDescription",
"discoveryVersion": "v1",
"id": "drive:v2internal",
"name": "drive",
"version": "v2internal",
"revision": "20180702",
"title": "Drive API",
"description": "Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.",
"ownerDomain": "google.com",
@fakedon
fakedon / drive-mimetypes.json
Created December 7, 2020 15:33 — forked from tks18/drive-mimetypes.json
List of all Google Drive MimeTypes
{
"name": "Drive Mime Types",
"types": [
{".323": "text/h323"},
{".3g2": "video/3gpp2"},
{".3gp": "video/3gpp"},
{".3gp2": "video/3gpp2"},
{".3gpp": "video/3gpp"},
{".7z": "application/x-7z-compressed"},
{".aa": "audio/audible"},

Keybase proof

I hereby claim:

  • I am fakedon on github.
  • I am fakedon (https://keybase.io/fakedon) on keybase.
  • I have a public key ASCw6wzXCht_FtMeTUCEzrSDxjcfejqvB1P4aCtBabiHcQo

To claim this, I am signing this object: