add the i2p news post

Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
ngn 2025-05-13 01:22:07 +03:00
parent d9588d6763
commit 53e63a96a4
Signed by: ngn
GPG Key ID: A3654DF5AD9F641D
2 changed files with 16 additions and 6 deletions

12
posts/i2p.json Normal file
View File

@ -0,0 +1,12 @@
{
"id": "i2p",
"title": {
"en": "Services are now available on I2P",
"tr": "Servisler artık I2P'den erişilebilir"
},
"author": "ngn",
"content": {
"en": "Services that are available on TOR, are now available on I2P as well.",
"tr": "TOR'dan erişilebilir olan servisler artık I2P'den de erişilebilirler."
}
}

View File

@ -1,16 +1,16 @@
#!/bin/bash #!/bin/bash
curl 'https://api.ngn.tf/v1/news/en' --silent -o feed.atom feed=$(curl 'https://ngn.tf/api/v1/news/en' --silent)
if [ $? -ne 0 ]; then if [ $? -ne 0 ] || [ -z "${feed}" ]; then
echo "failed to get the feed" echo "failed to get the feed"
exit 1 exit 1
fi fi
for p in posts/*; do for p in posts/*; do
post_title="$(jq -r .title.en "${p}")" title="$(jq -r .title.en "${p}")"
if grep "<title>${post_title}</title>" feed.atom &> /dev/null; then if [[ "${feed}" == *"${title}"* ]]; then
echo "${p} is already posted, skipping" echo "${p} is already posted, skipping"
continue continue
fi fi
@ -23,5 +23,3 @@ for p in posts/*; do
break break
fi fi
done done
rm -f feed.atom