Commit c8da5837 authored by Vincent's avatar Vincent

Merge branch 'master' of

parents dd998e54 eb513214
Pipeline #25531966 passed with stage
in 3 minutes and 5 seconds
image: node:8
- review
- deploy
REPO_NAME: whereisscihubnow
stage: review
- npm install -g --unsafe-perm now
- URL=$(now --public -t ${NOW_TOKEN} -n ${REPO_NAME}-${CI_COMMIT_REF_SLUG})
- NOW_URL=$(echo ${URL} | sed s/'http:\/\/'/''/g | sed s/'https:\/\/'//g)
- now -t ${NOW_TOKEN} alias set ${NOW_URL} ${REPO_NAME}-${CI_COMMIT_REF_SLUG}
name: review/$CI_BUILD_REF_NAME
url: https://$REPO_NAME-$
on_stop: stop_review
- branches
- master
stage: review
- npm install -g --unsafe-perm now
- now rm -t ${NOW_TOKEN} -y ${REPO_NAME}-${CI_COMMIT_REF_SLUG}
when: manual
name: review/$CI_BUILD_REF_NAME
action: stop
- branches
- master
stage: deploy
- npm install -g --unsafe-perm now
- URL=$(now --public -t ${NOW_TOKEN} -n ${REPO_NAME}-${CI_COMMIT_REF_SLUG})
- NOW_URL=$(echo ${URL} | sed s/'http:\/\/'/''/g | sed s/'https:\/\/'//g)
- now -t ${NOW_TOKEN} alias set ${NOW_URL}
name: production
- master
# WhereIsSciHub
A barebones Node.js app using [Express 4](
Fetches the URLs currently [listed on WikiData as working for Sci-Hub](,
and hosts a webpage listing those URLs (and a service to automatically redirect the visitor to those URLs at `/go`),
and that is always up-to-date with whatever Sci-Hub URLs are currently valid.
Try it out at
## Running Locally
Make sure you have [Node.js]( and the [Heroku CLI]( installed.
Make sure you have [Node]( installed.
$ git clone # or clone your own fork
......@@ -15,23 +18,30 @@ $ npm start
Your app should now be running on [localhost:5000](http://localhost:5000/).
## Deploying to Heroku
## Deploying to
You can deploy it to []( using the following command.
Note that you need your own account there (you will be asked to create one when
running the command), and that it will be deployed to a separate subdomain.
$ heroku create
$ git push heroku master
$ heroku open
$ npx now
[![Deploy to Heroku](](
(`npx` [is provided by the Node package manager](
## Navigating the source code
## Documentation
The app is written in Javascript and is really quite simple. It consists of a
single file, [index.html](/index.html). The meat of the application is the
function `getUrls` at the bottom of the file, which fetches the current Sci-Hub
URLs from WikiData (using [SPARQL](
For more information about using Node.js on Heroku, see these Dev Center articles:
It also starts a small web server using [Express](, to
serve the following endpoints:
- [Getting Started with Node.js on Heroku](
- [Heroku Node.js Support](
- [Node.js on Heroku](
- [Best Practices for Node.js Development](
- [Using WebSockets on Heroku with Node.js](
- `/favicon.ico` - the [Favicon](
- `/api` - providing the list of URLs as [JSON](
- `/go` - directly redirect the user to the URL currently listed on WikiData as preferred
- `/go/*` - directly redirect the user to the preferred URL, passing on anything beind `/go/` to that URL. This allows users to e.g. directly append a DOI or a link to an article to find it on Sci-Hub.
- `/` - a simple HTML page listing the URLs for human consumption, and providing links to e.g. this source code :)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment