This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Written by capjamesg | |
# Required dependencies: requests, beautifulsoup4 | |
from bs4 import BeautifulSoup | |
import requests | |
# Please save your opml file as feed.opml before running this program, otherwise you'll encounter an error | |
with open("feed.opml", "r") as file: | |
contents = file.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make BookParts directory | |
rm -r BookParts && rm book.pdf | |
if [ ! -d "BookParts" ]; then | |
mkdir BookParts | |
fi | |
if [ ! -d "BookParts/new" ]; then | |
mkdir BookParts/new | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import mf2py | |
def checker(mf2prop, mf1prop, filename): | |
with open(filename, "r") as file: | |
file_names = list(file.readlines()) | |
counter = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# draft of autotag function for use in indieweb-utils | |
import re | |
def _match_tag(tag_prefix: str, match: re.Match, user_tags: dict) -> str: | |
""" | |
Match a tag and return a link to the tag page. | |
:param tag_prefix: The prefix to append to the tag. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
note = "I am presently having coffee with @example. #coffee #lunch #breakfast" #* 10000 | |
person_tags_reference = { | |
"example": ("Example Person", "example.com/bio"), | |
} | |
tags = ["coffee", "lunch", "breakfast"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapting https://gist.github.com/angelogladding/c61488d2dd82fb73b9078541a4e2ea13 for library use | |
import re | |
from urllib.parse import urlparse | |
REST = r"(?P<rest>.*)" | |
DOMAIN_PATTERN = r"^(?P<domain>\w.[^/]+)/" + REST | |
url_summary_templates = { | |
"github.com": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapting https://gist.github.com/angelogladding/c61488d2dd82fb73b9078541a4e2ea13 for library use | |
import re | |
REST = r"(?P<rest>.*)" | |
DOMAIN_PATTERN = r"^http[s]?://(?P<domain>\w.[^/]+)/" + REST | |
url_summary_templates = [ | |
( | |
r"http[s]?://github.com/(?P<user>\w+)/(?P<project>[\w-]+)/", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib.parse import urlparse | |
url = "https://github.com/capjamesg/indieweb-utils/pulls/1" | |
def _python_pull_request(path): | |
if len(path) > 2 or path[2] != "pulls": | |
return "A comment on a pull request in the " + path[1] + " GitHub repository." | |
def _python_generic_comment(path): | |
if len(path) >= 1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code to advance discussion around url_summary implementation | |
# Still in development | |
from urllib.parse import urlparse | |
url = "https://github.com/capjamesg/indieweb-utils/pulls/1" | |
callbacks = { | |
"github.com": [ | |
lambda path: "A comment on pull request " + path[1] if len(path) > 2 and path[2] == "pulls" else "", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT COUNT(page) AS mf2_count FROM `httparchive.all.pages` WHERE date = "2022-08-01" AND payload LIKE "%authorization_endpoint%"; |
NewerOlder