bryantd / letterboxd-feed-wp Goto Github PK
View Code? Open in Web Editor NEWPersonalized code to replicate my Letterboxd reviews to WordPress
License: MIT License
Personalized code to replicate my Letterboxd reviews to WordPress
License: MIT License
Belongs in write_movies_to_wp
-- see the comments in that function for some details.
See https://stackoverflow.com/questions/33131103/wp-rest-api-get-post-by-title
The regrettable answer is to do a broader search and check the titles returned.
E.g.:
curl https://popone.innocence.com/wp-json/wp/v2/tags | jq .
You don't need to be logged in for this.
Just needs another check on config values, maybe an error handler for opening the CSV.
I've been messing around with this for a month; I should probably take the time to add OAuth.
Currently assuming that it's always /wp-json/wp/v2/ but it isn't necessarily. See https://developer.wordpress.org/rest-api/using-the-rest-api/discovery/ for instructions.
Only process reviews for movies watched between those dates.
Also consider a pre-commit check w/flake8 and black.
In write_movies_to_wp_by_week
, we sort movies into buckets by year and week, which means weeks spanning years result in bogus bucketing.
Fixable by just going back to the previous Monday (which would also fix part of #25) and iterating over 7 day chunks from there.
One of the two fetches isn't filtering out movie posters properly.
Possible that a review will change and a single review post will need to be updated, so check for that. Should just be part of write_movies_to_wp
.
It takes forever to run the script on a large export even if you just need to fill in a couple of weeks. --start-date and --end-date should work here.
Script should behave gracefully if they don't exist.
As per the wp_post function:
try:
response = requests.post(
f"{wp_post_api}/{post_id}", headers=wp_headers, json=post
)
except requests.exceptions as error:
print(f"ERROR: post failed: {error}")
if response.status_code != requests.codes.ok:
print(f"ERROR: post failed w/status code {response.status_code}")
Every use of requests should look more like that.
I'm the only human being in the world stubborn enough to write a mini-plugin to make WordPress use cite tags.
Since I currently implement dates via the SQL SELECT statement, if I use the writeweeks option, I run the risk of missing movies in the weeks containing the start/end date. Probably the fix to this is to do some date math and expand the date range to contain full weeks as needed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.