pulls.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
       ---
       pulls.dcgi
       ---
            1 #!/bin/sh
            2 
            3 . ../common/config.sh
            4 
            5 ISSUE_CGI="${CGI_BASEDIR}/github/issue.dcgi"
            6 ISSUES_CGI="${CGI_BASEDIR}/github/issues.dcgi"
            7 COMMITS_CGI="${CGI_BASEDIR}/github/commits.dcgi"
            8 PULLS_CGI="${CGI_BASEDIR}/github/pulls.dcgi"
            9 PULL_CGI="${CGI_BASEDIR}/github/pull.dcgi"
           10 
           11 
           12 case "$2" in
           13 */*)
           14         owner=${2%%/*}
           15         repo=${2##*/}
           16         ;;
           17 *)
           18         exit 1
           19         ;;
           20 esac
           21 
           22 
           23 url="https://api.github.com/repos/${owner}/${repo}/pulls"
           24 curl -Lgs -- "${url}" |
           25     jq -r '
           26     "t",
           27     "tGitHub - '"${owner}/${repo}"' pull requests",
           28     "t",
           29     ( .[] |
           30         "[1|#\(.number) \(.title | gsub("\\|"; "\\|"))|" +
           31             "'"${PULL_CGI}?${owner}/${repo}/"'\(.number)|server|port]",
           32         "t\(.state)   @\(.user.login)   \(.created_at[0:10])",
           33         "[h|patch|URL:\(.patch_url)|server|port]",
           34         "t"
           35     )
           36 '