Fixed bad pasword case. Improved help message.

This commit is contained in:
Christian P. MOMON 2019-04-13 04:23:36 +02:00 committed by Christian P. MOMON
parent d383c03258
commit 4af37042fd
1 changed files with 15 additions and 13 deletions

View File

@ -27,6 +27,7 @@ help()
echo "Usage:" echo "Usage:"
echo " ccfmstat [ -h | -help | --help ]" echo " ccfmstat [ -h | -help | --help ]"
echo "If no parameter set then password is requested." echo "If no parameter set then password is requested."
echo "Number of result per page has to be fixed un web GUI page."
} }
# ############################################ # ############################################
@ -112,23 +113,25 @@ run()
idsFile="${tmpPrefix}-listmiens" idsFile="${tmpPrefix}-listmiens"
curl -s -b "$cookieFile" "$pageUrl" | grep row-title > "$idsFile" curl -s -b "$cookieFile" "$pageUrl" | grep row-title > "$idsFile"
if [ $? -eq 0 ]; then
# <strong><a class="row-title" href="https://cause-commune.fm/wp-admin/post.php?post=10518&amp;action=edit" aria-label="« Wikipédia &#8211; chronique « Partager est bon » sur écoles et logiciels libres » (Modifier)">Wikipédia &#8211; chronique « Partager est bon » sur écoles et logiciels libres</a></strong>
# <strong><a class="row-title" href="https://cause-commune.fm/wp-admin/post.php?post=10518&amp;action=edit" aria-label="« Wikipédia &#8211; chronique « Partager est bon » sur écoles et logiciels libres » (Modifier)">Wikipédia &#8211; chronique « Partager est bon » sur écoles et logiciels libres</a></strong> echo -e "id\ttotalListens\ttotalListeners\tiTunes\tpocketcasts\tovercast\tdirectDownload\tplayedInNewWindow\taudioPlayer\tpodcastAddict\tplayerFM\tother\trecordedDate\ttitle"
while read line; do
#echo $line
[[ $line =~ post=([0-9]+)\&amp ]] && id=${BASH_REMATCH[1]}
#echo "TRACE id=$id"
echo -e "id\ttotalListens\ttotalListeners\tiTunes\tpocketcasts\tovercast\tdirectDownload\tplayedInNewWindow\taudioPlayer\tpodcastAddict\tplayerFM\tother\trecordedDate\ttitle" [[ $line =~ aria-label=\".+\"\>(.+)\</a\> ]] && title=${BASH_REMATCH[1]}
#echo "TRACE title=$title"
while read line; do getInfoFromId "$id" "$title" "$cookieFile"
#echo $line
[[ $line =~ post=([0-9]+)\&amp ]] && id=${BASH_REMATCH[1]}
#echo "TRACE id=$id"
[[ $line =~ aria-label=\".+\"\>(.+)\</a\> ]] && title=${BASH_REMATCH[1]} done < "$idsFile"
#echo "TRACE title=$title" else
echo "Connexion error. Bad password?"
getInfoFromId "$id" "$title" "$cookieFile" fi
done < "$idsFile"
} }
# ########################################### # ###########################################
@ -148,7 +151,6 @@ else
# Clean temporary files. # Clean temporary files.
# Clean. # Clean.
if [ -n "${tmpPrefix}" ]; then if [ -n "${tmpPrefix}" ]; then
ls "${tmpPrefix}-"*
rm -f "${tmpPrefix}-"* rm -f "${tmpPrefix}-"*
fi fi
fi fi