add the i2p news post
Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
parent
d9588d6763
commit
53e63a96a4
12
posts/i2p.json
Normal file
12
posts/i2p.json
Normal 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."
|
||||||
|
}
|
||||||
|
}
|
10
update.sh
10
update.sh
@ -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
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user