Skip to content

Commit 3d6d6c0

Browse files
committed
update docs
1 parent 6d4a2e3 commit 3d6d6c0

File tree

6 files changed

+154
-4
lines changed

6 files changed

+154
-4
lines changed

.github/workflows/google_scholar_crawler.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@v2
9-
with:
10-
ref: google-scholar-crawler
119
- name: Install Reqs
1210
run: |
1311
sudo apt-get install python3-setuptools
14-
pip3 install -r requirements.txt
1512
- name: Run
1613
run: |
14+
cd ./google_scholar_crawler
15+
pip3 install -r requirements.txt
1716
python3 main.py
1817
cd ./results
1918
git init

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
_site/
2-
/push.sh
2+
push.sh
33
.DS_Store

_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ include:
6666
- files
6767
exclude:
6868
- docs
69+
- google_scholar_crawler
6970
- "*.sublime-project"
7071
- "*.sublime-workspace"
7172
- .asset-cache

google_scholar_crawler/.gitignore

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
*.json
2+
.DS_Store
3+
/push.sh
4+
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
10+
# C extensions
11+
*.so
12+
13+
# Distribution / packaging
14+
.Python
15+
build/
16+
develop-eggs/
17+
dist/
18+
downloads/
19+
eggs/
20+
.eggs/
21+
lib/
22+
lib64/
23+
parts/
24+
sdist/
25+
var/
26+
wheels/
27+
pip-wheel-metadata/
28+
share/python-wheels/
29+
*.egg-info/
30+
.installed.cfg
31+
*.egg
32+
MANIFEST
33+
34+
# PyInstaller
35+
# Usually these files are written by a python script from a template
36+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
37+
*.manifest
38+
*.spec
39+
40+
# Installer logs
41+
pip-log.txt
42+
pip-delete-this-directory.txt
43+
44+
# Unit test / coverage reports
45+
htmlcov/
46+
.tox/
47+
.nox/
48+
.coverage
49+
.coverage.*
50+
.cache
51+
nosetests.xml
52+
coverage.xml
53+
*.cover
54+
*.py,cover
55+
.hypothesis/
56+
.pytest_cache/
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
local_settings.py
65+
db.sqlite3
66+
db.sqlite3-journal
67+
68+
# Flask stuff:
69+
instance/
70+
.webassets-cache
71+
72+
# Scrapy stuff:
73+
.scrapy
74+
75+
# Sphinx documentation
76+
docs/_build/
77+
78+
# PyBuilder
79+
target/
80+
81+
# Jupyter Notebook
82+
.ipynb_checkpoints
83+
84+
# IPython
85+
profile_default/
86+
ipython_config.py
87+
88+
# pyenv
89+
.python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
99+
__pypackages__/
100+
101+
# Celery stuff
102+
celerybeat-schedule
103+
celerybeat.pid
104+
105+
# SageMath parsed files
106+
*.sage.py
107+
108+
# Environments
109+
.env
110+
.venv
111+
env/
112+
venv/
113+
ENV/
114+
env.bak/
115+
venv.bak/
116+
117+
# Spyder project settings
118+
.spyderproject
119+
.spyproject
120+
121+
# Rope project settings
122+
.ropeproject
123+
124+
# mkdocs documentation
125+
/site
126+
127+
# mypy
128+
.mypy_cache/
129+
.dmypy.json
130+
dmypy.json
131+
132+
# Pyre type checker
133+
.pyre/

google_scholar_crawler/main.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from scholarly import scholarly
2+
import jsonpickle
3+
import json
4+
from datetime import datetime
5+
import os
6+
7+
author = scholarly.search_author_id(os.environ['GOOGLE_SCHOLAR_ID'])
8+
scholarly.fill(author, sections=['basics', 'indices', 'counts', 'publications'])
9+
name = author['name']
10+
author['updated'] = str(datetime.now())
11+
author['publications'] = {v['author_pub_id']:v for v in author['publications']}
12+
print(json.dumps(author, indent=2))
13+
os.makedirs('results', exist_ok=True)
14+
with open(f'results/gs_data.json', 'w') as outfile:
15+
json.dump(author, outfile, ensure_ascii=False)
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
jsonpickle==1.4.2
2+
scholarly==1.5.1

0 commit comments

Comments
 (0)