No more need to keep sharing links to Sci-Hub on Twitter. This site always links to the latest version of Sci-Hub.
  • JavaScript 99.8%
  • Procfile 0.2%
Find a file
2019-11-25 14:43:03 +07:00
.gitignore update .gitignore 2016-04-18 12:12:10 +01:00
.gitlab-ci.yml Stop logging email addresses kthxbai 2018-07-11 11:39:45 +02:00
app.json Update app.json 2017-05-10 15:13:06 -07:00
favicon.ico Add a favicon 2018-03-15 14:29:25 +01:00
index.js [INDEX] Fix single slash HTTP 2019-11-25 14:43:03 +07:00
LICENSE Add MIT License 2018-03-15 13:24:14 +01:00
now.json [NOW] Add now.json file 2019-11-25 14:42:07 +07:00
package-lock.json Add a favicon 2018-03-15 14:29:25 +01:00
package.json [PACKAGE] Remove old engine spec 2019-11-25 14:41:44 +07:00
Procfile Modernize and remove accidental commits (#84) 2017-11-15 16:38:49 -08:00
README.md Mention being up-to-date, which is important 2018-07-11 07:26:02 +00:00

WhereIsSciHub

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 https://whereisscihub.now.sh/.

Running Locally

Make sure you have Node installed.

$ git clone git@gitlab.com:Flockademic/whereisscihub.git # or clone your own fork
$ cd whereisscihub
$ npm install
$ npm start

Your app should now be running on localhost:5000.

Deploying to Now.sh

You can deploy it to Now.sh 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.

$ npx now

(npx is provided by the Node package manager.)

Navigating the source code

The app is written in Javascript and is really quite simple. It consists of a single file, 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).

It also starts a small web server using Express, to serve the following endpoints:

  • /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 :)