Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
RayeRen committed Feb 22, 2022
1 parent 6d4a2e3 commit 3d6d6c0
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/google_scholar_crawler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: google-scholar-crawler
- name: Install Reqs
run: |
sudo apt-get install python3-setuptools
pip3 install -r requirements.txt
- name: Run
run: |
cd ./google_scholar_crawler
pip3 install -r requirements.txt
python3 main.py
cd ./results
git init
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
_site/
/push.sh
push.sh
.DS_Store
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ include:
- files
exclude:
- docs
- google_scholar_crawler
- "*.sublime-project"
- "*.sublime-workspace"
- .asset-cache
Expand Down
133 changes: 133 additions & 0 deletions google_scholar_crawler/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
*.json
.DS_Store
/push.sh

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
15 changes: 15 additions & 0 deletions google_scholar_crawler/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from scholarly import scholarly
import jsonpickle
import json
from datetime import datetime
import os

author = scholarly.search_author_id(os.environ['GOOGLE_SCHOLAR_ID'])
scholarly.fill(author, sections=['basics', 'indices', 'counts', 'publications'])
name = author['name']
author['updated'] = str(datetime.now())
author['publications'] = {v['author_pub_id']:v for v in author['publications']}
print(json.dumps(author, indent=2))
os.makedirs('results', exist_ok=True)
with open(f'results/gs_data.json', 'w') as outfile:
json.dump(author, outfile, ensure_ascii=False)
2 changes: 2 additions & 0 deletions google_scholar_crawler/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jsonpickle==1.4.2
scholarly==1.5.1

0 comments on commit 3d6d6c0

Please sign in to comment.