Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Citation number #123

Open
mrkevinyuan opened this issue Jul 3, 2019 · 1 comment
Open

Citation number #123

mrkevinyuan opened this issue Jul 3, 2019 · 1 comment

Comments

@mrkevinyuan
Copy link

Hi

I am currently working on a project on citation prediction of articles and using the shcolar.py package.
I am wondering do you have any command line parameter that comes out of the code and can only give me the result of each article's citation number?(just the counting nunber, eg. 200)

Thanks
Kevin Yuan

@Misty-2409
Copy link

Misty-2409 commented Jan 3, 2021

following works for me. Just merged #50 and #128

`import scholar

author = "Julita Vassileva"
title = "Trust and reputation model in peer-to-peer networks"

art = ["-c", "1",
"--author", author,
"--phrase", title
]

querier = scholar.ScholarQuerier()
settings = scholar.ScholarSettings()
settings.set_citation_format(4)
querier.apply_settings(settings)

#Take in search phrase and return BibTex of first article found
def searchScholar(searchphrase):
query = scholar.SearchScholarQuery()
query.set_words(searchphrase)
querier.send_query(query)
articles = querier.articles
return articles[0].attrs['num_citations'][0]

print("number of citation = ",searchScholar(art))`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants