-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add script to check if lead picture is not equal the favicon and if t… #1
base: main
Are you sure you want to change the base?
Conversation
…he lead picture number is less than two
good idea! but maybe we can integrate this into our python script so we make sure its not forgotten to be executed. saves us also from administrating the variables (like languages) in two destinations. |
Yes, that should be possible. I just integrated it into the bash wrapper script. Before i go on detecting the languages, please tell me if it makes sense like this? For detecting languages i could do it the bash way (starting with Or do you really want this to be implemented in pure python without any bash? |
feed="https://weeklyosm.eu/feed" | ||
article_id=$(curl -Ls "$feed" | grep "<link>https://weeklyosm.eu/archives/" | head -n 1 | cut -d "<" -f 2 | grep -o '[^/]*$') | ||
else | ||
article_id=$1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are calling our script with parameters - so I guess this would always go this path. $1 would be the first parameter, which is not the article id at the moment.
initially, I was thinking that your proposed check would be better placed here. Please check it is compatible and remove the check from python, too. And then, let's continue your idea and eliminate (in a second PR) the necessity to manually add the parameters:
|
@@ -1,4 +1,6 @@ | |||
#!/bin/bash | |||
set -e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a bash pro - but would that mean also the actual notification script would abort on error? For example if an error is thrown, because a telegram group removed permissions for our bot?
ah, there is the list of languages |
your great idea to parse the parameters lead into this commit. Thank you for the inspiration! |
Nice. If we already have the blog URL then, we can do the check for the favicon in python, too. So no need to update my bash script i would suggest |
6084c93
to
0156753
Compare
…he lead picture number is less than two
This is just a safety net to not get the favicon as share image as it was in past. Maybe we can add this anyhow so that it runs before the great notifying starts?