复制 App ID 和 App Key 填入 backup.py 的 client_id
和 client_secret
rye pin 3.11
rye add requests
rye sync
复制 App ID 和 App Key 填入 backup.py 的 client_id
和 client_secret
rye pin 3.11
rye add requests
rye sync
import ssl | |
from typing import List | |
from urllib.parse import urlparse | |
from xml.etree import ElementTree as ET | |
import feedparser | |
import requests | |
from bs4 import BeautifulSoup, ResultSet | |
ssl._create_default_https_context = ssl._create_unverified_context |
@import url(https://fonts.googleapis.com/css?family=Miriam+Libre:400,700&display=swap); | |
a.title { | |
font-family: 'Miriam Libre', Noto Sans CJK SC, Microsoft YaHei, sans-serif, Apple Color Emoji, Segoe UI Emoji!important | |
} | |
#content-wrap#content-wrap .content, | |
#content-wrap#content-wrap .content-inner, | |
#feedTree, | |
body { | |
font-family: Avenir Next, -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, PingFang SC, Noto Sans CJK SC, Microsoft YaHei, sans-serif, Apple Color Emoji, Segoe UI Emoji!important |
Please refer to this blogpost to get an overview.
Replace *-INSTANCE
with one of the public instances listed in the scrapers section. Replace CAPITALIZED
words with their corresponding identifiers on the website.
Feed will support xcal (xml representation of ical). This allows us to handle event schedules (PBR) in a nice way
Feed will also support the media rss spec as part of our RSS parsing. This allows a nice way to provide links to assets (images, video, etc) within the rss feed in a standardized way.
Both of these require the tag to add additional XML namespaces (xmlns:media, xmlns:xcal).
These are used within an RSS feed like so:
<?xml version="1.0"?>
<rss version="2.0"
<?xml version="1.0" encoding="UTF-8"?> | |
<opml version="1.0"> | |
<head> | |
<title>晓哲 subscriptions in feedly Cloud</title> | |
</head> | |
<body> | |
<outline text="前端" title="前端"> | |
<outline type="rss" text="掌心" title="掌心" xmlUrl="http://www.zhanxin.info/feed.xml" htmlUrl="http://www.zhanxin.info/feed.xml"/> | |
<outline type="rss" text="Blog of Wenli Zhang" title="Blog of Wenli Zhang" xmlUrl="http://zhangwenli.com/blog/feed.xml" htmlUrl="http://zhangwenli.com/blog"/> |
#!/usr/bin/env python | |
# This function prints the difference between two python datetime objects | |
# in a more human readable form | |
# | |
# Adapted from: http://www.chimeric.de/blog/2008/0711_smart_dates_in_python | |
def humanize_date_difference(now, otherdate=None, offset=None): | |
if otherdate: | |
dt = otherdate - now | |
offset = dt.seconds + (dt.days * 60*60*24) |