- JavaScript 99.8%
- Procfile 0.2%
|
|
||
|---|---|---|
| .gitignore | ||
| .gitlab-ci.yml | ||
| app.json | ||
| favicon.ico | ||
| index.js | ||
| LICENSE | ||
| now.json | ||
| package-lock.json | ||
| package.json | ||
| Procfile | ||
| README.md | ||
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 :)