Adjust curl invocations. - gophercgis - Collection of gopher CGI/DCGI for geomyidae (HTM) hg clone https://bitbucket.org/iamleot/gophercgis (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) changeset d80b6967472516e3b0b7246f5219af7bbb9d2b41 (DIR) parent a4a2d4582abf2e4fe9ce365e34635761d9fd6356 (HTM) Author: Leonardo Taccari <iamleot@gmail.com> Date: Sun, 9 Sep 2018 17:04:04 Adjust curl invocations. Always invoke curl via `-Lgs' options and avoid possible further option parsing by adding a `--' before the URL. Diffstat: acmqueue/article.cgi | 2 +- acmqueue/feed.dcgi | 2 +- ansa/article.cgi | 2 +- ansa/feed.dcgi | 2 +- espresso/article.cgi | 2 +- espresso/feed.dcgi | 2 +- feeds/feed.dcgi | 2 +- github/commits.dcgi | 2 +- github/issue.dcgi | 2 +- github/issues.dcgi | 2 +- github/pull.dcgi | 2 +- github/pulls.dcgi | 2 +- github/repo.dcgi | 2 +- instagram/user.dcgi | 4 ++-- internazionale/article.cgi | 2 +- lwn/article.cgi | 2 +- lwn/feed.dcgi | 2 +- reddit/c.cgi | 2 +- reddit/r.dcgi | 2 +- rep/article.cgi | 2 +- technologyreview/article.cgi | 2 +- technologyreview/feed.dcgi | 2 +- theatlantic/article.cgi | 2 +- theatlantic/feed.dcgi | 2 +- theguardian/article.cgi | 2 +- theguardian/feed.dcgi | 2 +- youtube/channel.dcgi | 2 +- 27 files changed, 28 insertions(+), 28 deletions(-) --- diff -r a4a2d4582abf -r d80b69674725 acmqueue/article.cgi --- a/acmqueue/article.cgi Sun Sep 09 10:50:05 2018 +0200 +++ b/acmqueue/article.cgi Sun Sep 09 17:04:04 2018 +0200 @@ -3,7 +3,7 @@ . ../common/html.sh url=$2 -/usr/pkg/bin/curl -sL "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | sed -ne '/^<h1 class="hidetitle">/p' | html_to_text diff -r a4a2d4582abf -r d80b69674725 acmqueue/feed.dcgi --- a/acmqueue/feed.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/acmqueue/feed.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -11,5 +11,5 @@ echo "" url="https://queue.acm.org/rss/feeds/queuecontent.xml" -/usr/pkg/bin/curl -gs "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | feed_to_gph diff -r a4a2d4582abf -r d80b69674725 ansa/article.cgi --- a/ansa/article.cgi Sun Sep 09 10:50:05 2018 +0200 +++ b/ansa/article.cgi Sun Sep 09 17:04:04 2018 +0200 @@ -36,7 +36,7 @@ url=$2 -/usr/pkg/bin/curl -sL "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | extract_article | filter_html | html_to_text diff -r a4a2d4582abf -r d80b69674725 ansa/feed.dcgi --- a/ansa/feed.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/ansa/feed.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -11,5 +11,5 @@ echo "" url="http://www.ansa.it/sito/ansait_rss.xml" -/usr/pkg/bin/curl -gs "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | feed_to_gph diff -r a4a2d4582abf -r d80b69674725 espresso/article.cgi --- a/espresso/article.cgi Sun Sep 09 10:50:05 2018 +0200 +++ b/espresso/article.cgi Sun Sep 09 17:04:04 2018 +0200 @@ -21,7 +21,7 @@ url="$2" -/usr/pkg/bin/curl -sL "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | extract_article | html_to_text diff -r a4a2d4582abf -r d80b69674725 espresso/feed.dcgi --- a/espresso/feed.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/espresso/feed.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -11,5 +11,5 @@ echo "" url="http://espresso.repubblica.it/rss?sezione=espresso" -/usr/pkg/bin/curl -gs "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | feed_to_gph diff -r a4a2d4582abf -r d80b69674725 feeds/feed.dcgi --- a/feeds/feed.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/feeds/feed.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -6,5 +6,5 @@ FEED_DATE=yes url="$2" -/usr/pkg/bin/curl -gs "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | feed_to_gph diff -r a4a2d4582abf -r d80b69674725 github/commits.dcgi --- a/github/commits.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/github/commits.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -20,7 +20,7 @@ url="https://api.github.com/repos/${owner}/${repo}/commits" -/usr/pkg/bin/curl -s "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | /usr/pkg/bin/jq -r ' "t", "tGitHub - '"${owner}/${repo}"' commits", diff -r a4a2d4582abf -r d80b69674725 github/issue.dcgi --- a/github/issue.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/github/issue.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -22,7 +22,7 @@ url="https://api.github.com/repos/${owner}/${repo}/issues/${issue}" -/usr/pkg/bin/curl -s "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | /usr/pkg/bin/jq -r ' "", "GitHub - '"${owner}/${repo}"' issue #'"${issue}"'", diff -r a4a2d4582abf -r d80b69674725 github/issues.dcgi --- a/github/issues.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/github/issues.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -19,7 +19,7 @@ url="https://api.github.com/repos/${owner}/${repo}/issues" -/usr/pkg/bin/curl -s "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | /usr/pkg/bin/jq -r ' "t", "tGitHub - '"${owner}/${repo}"' issues", diff -r a4a2d4582abf -r d80b69674725 github/pull.dcgi --- a/github/pull.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/github/pull.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -23,7 +23,7 @@ url="https://api.github.com/repos/${owner}/${repo}/pulls/${pull}" -/usr/pkg/bin/curl -s "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | /usr/pkg/bin/jq -r ' "", "GitHub - '"${owner}/${repo}"' pull request #'"${pull}"'", diff -r a4a2d4582abf -r d80b69674725 github/pulls.dcgi --- a/github/pulls.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/github/pulls.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -20,7 +20,7 @@ url="https://api.github.com/repos/${owner}/${repo}/pulls" -/usr/pkg/bin/curl -s "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | /usr/pkg/bin/jq -r ' "t", "tGitHub - '"${owner}/${repo}"' pull requests", diff -r a4a2d4582abf -r d80b69674725 github/repo.dcgi --- a/github/repo.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/github/repo.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -19,7 +19,7 @@ url="https://api.github.com/repos/${owner}/${repo}" -/usr/pkg/bin/curl -s "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | /usr/pkg/bin/jq -r ' "t", "tGitHub - \(.full_name)", diff -r a4a2d4582abf -r d80b69674725 instagram/user.dcgi --- a/instagram/user.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/instagram/user.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -83,14 +83,14 @@ gis=$(printf "%s" "${rhx_gis}:${variables}" | md5 -q) fetch_cmd() { - /usr/pkg/bin/curl -H "X-Instagram-GIS: ${gis}" -sL -g "${url}" + /usr/pkg/bin/curl -H "X-Instagram-GIS: ${gis}" -Lgs -- "${url}" } else header="${profile_header}" footer="${profile_footer}" url="https://www.instagram.com/${user}/" fetch_cmd() { - /usr/pkg/bin/curl -sL -g "${url}" | + /usr/pkg/bin/curl -Lgs -- "${url}" | sed -ne 's/;<\/script>$//' -e '/sharedData =/s/^.*sharedData = //p' } fi diff -r a4a2d4582abf -r d80b69674725 internazionale/article.cgi --- a/internazionale/article.cgi Sun Sep 09 10:50:05 2018 +0200 +++ b/internazionale/article.cgi Sun Sep 09 17:04:04 2018 +0200 @@ -54,7 +54,7 @@ url=$2 -/usr/pkg/bin/curl -sL "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | extract_article | filter_html | html_to_text diff -r a4a2d4582abf -r d80b69674725 lwn/article.cgi --- a/lwn/article.cgi Sun Sep 09 10:50:05 2018 +0200 +++ b/lwn/article.cgi Sun Sep 09 17:04:04 2018 +0200 @@ -39,7 +39,7 @@ url=$2 -/usr/pkg/bin/curl -sL "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | extract_article | filter_html | html_to_text diff -r a4a2d4582abf -r d80b69674725 lwn/feed.dcgi --- a/lwn/feed.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/lwn/feed.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -30,6 +30,6 @@ echo "" url="https://lwn.net/headlines/newrss" -/usr/pkg/bin/curl -gs "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | feed_to_gph | filter_entries diff -r a4a2d4582abf -r d80b69674725 reddit/c.cgi --- a/reddit/c.cgi Sun Sep 09 10:50:05 2018 +0200 +++ b/reddit/c.cgi Sun Sep 09 17:04:04 2018 +0200 @@ -10,7 +10,7 @@ ua="" url="https://www.reddit.com/r/${subreddit}/comments/${id}/.json" -/usr/pkg/bin/curl -A "${ua}" -s "${url}" | +/usr/pkg/bin/curl -A "${ua}" -Lgs -- "${url}" | /usr/pkg/bin/jq -r ' ( .[0] | .data.children[] | .data | "", diff -r a4a2d4582abf -r d80b69674725 reddit/r.dcgi --- a/reddit/r.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/reddit/r.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -21,7 +21,7 @@ echo "tr/${subreddit}" echo "t" -/usr/pkg/bin/curl -A "${ua}" -s "${url}" | +/usr/pkg/bin/curl -A "${ua}" -Lgs -- "${url}" | /usr/pkg/bin/jq -r ' ( .data.children[] | .data | "[h|\(.title | gsub("\\|"; "\\|") )|" + diff -r a4a2d4582abf -r d80b69674725 rep/article.cgi --- a/rep/article.cgi Sun Sep 09 10:50:05 2018 +0200 +++ b/rep/article.cgi Sun Sep 09 17:04:04 2018 +0200 @@ -47,7 +47,7 @@ url=$2 -/usr/pkg/bin/curl -gsL "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | extract_article | filter_html | html_to_text diff -r a4a2d4582abf -r d80b69674725 technologyreview/article.cgi --- a/technologyreview/article.cgi Sun Sep 09 10:50:05 2018 +0200 +++ b/technologyreview/article.cgi Sun Sep 09 17:04:04 2018 +0200 @@ -61,7 +61,7 @@ ;; esac -/usr/pkg/bin/curl -sL "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | { /usr/pkg/bin/xmllint --html --format --xpath '//main' - 2>/dev/null ; } | extract_section | filter_html | diff -r a4a2d4582abf -r d80b69674725 technologyreview/feed.dcgi --- a/technologyreview/feed.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/technologyreview/feed.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -11,5 +11,5 @@ echo "" url="https://www.technologyreview.com/stories.rss" -/usr/pkg/bin/curl -gs "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | feed_to_gph diff -r a4a2d4582abf -r d80b69674725 theatlantic/article.cgi --- a/theatlantic/article.cgi Sun Sep 09 10:50:05 2018 +0200 +++ b/theatlantic/article.cgi Sun Sep 09 17:04:04 2018 +0200 @@ -3,7 +3,7 @@ . ../common/html.sh url=$2 -/usr/pkg/bin/curl -sL "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | { /usr/pkg/bin/xmllint --html --xpath '//article' - 2>/dev/null ; } | html_to_text diff -r a4a2d4582abf -r d80b69674725 theatlantic/feed.dcgi --- a/theatlantic/feed.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/theatlantic/feed.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -45,5 +45,5 @@ echo "" url="https://www.theatlantic.com/feed/channel/${section}/" -/usr/pkg/bin/curl -gs "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | feed_to_gph diff -r a4a2d4582abf -r d80b69674725 theguardian/article.cgi --- a/theguardian/article.cgi Sun Sep 09 10:50:05 2018 +0200 +++ b/theguardian/article.cgi Sun Sep 09 17:04:04 2018 +0200 @@ -43,7 +43,7 @@ url=$2 -/usr/pkg/bin/curl -sL "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | extract_article | filter_html | html_to_text diff -r a4a2d4582abf -r d80b69674725 theguardian/feed.dcgi --- a/theguardian/feed.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/theguardian/feed.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -53,5 +53,5 @@ echo "" url="https://www.theguardian.com/${section}/rss" -/usr/pkg/bin/curl -gs "${url}" | +/usr/pkg/bin/curl -Lgs -- "${url}" | feed_to_gph diff -r a4a2d4582abf -r d80b69674725 youtube/channel.dcgi --- a/youtube/channel.dcgi Sun Sep 09 10:50:05 2018 +0200 +++ b/youtube/channel.dcgi Sun Sep 09 17:04:04 2018 +0200 @@ -7,5 +7,5 @@ FEED_DATE=yes channel="$2" -/usr/pkg/bin/curl -gs "https://www.youtube.com/feeds/videos.xml?channel_id=${channel}" | +/usr/pkg/bin/curl -Lgs -- "https://www.youtube.com/feeds/videos.xml?channel_id=${channel}" | feed_to_gph