feed.dcgi - 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
---
feed.dcgi
---
1 #!/bin/sh
2
3 . ../common/config.sh
4 . ../common/feed.sh
5
6 FEED_AUTHOR=yes
7 FEED_DATE=yes
8 ARTICLE_CGI="${CGI_BASEDIR}/theatlantic/article.cgi"
9
10 section_to_subtitle()
11 {
12 section="$1"
13
14 case "${section}" in
15 politics) subtitle="Politics" ;;
16 business) subtitle="Business" ;;
17 entertainment) subtitle="Culture" ;;
18 international) subtitle="Global" ;;
19 technology) subtitle="Technology" ;;
20 national) subtitle="U.S." ;;
21 health) subtitle="Health" ;;
22 video) subtitle="Video" ;;
23 education) subtitle="Education" ;;
24 family) subtitle="Family" ;;
25 science) subtitle="Science" ;;
26 letters) subtitle="Letters" ;;
27 news) subtitle="News" ;;
28 press-releases) subtitle="Press Releases" ;;
29 newsletters) subtitle="Newsletters" ;;
30 membership) subtitle="The Masthead" ;;
31 *) subtitle="" ;;
32 esac
33
34 echo "${subtitle}"
35 }
36
37 section="$2"
38 subtitle=$(section_to_subtitle "${section}")
39 if [ -z "${subtitle}" ]; then
40 echo "[3|Invalid section|Err|server|port]"
41 exit 1
42 fi
43
44 echo ""
45 echo "The Atlantic - ${subtitle}"
46 echo ""
47
48 url="https://www.theatlantic.com/feed/channel/${section}/"
49 curl -Lgs -- "${url}" |
50 feed_to_gph