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

Documentation for basic usage #23

Open
elvismdev opened this issue Sep 2, 2021 · 2 comments
Open

Documentation for basic usage #23

elvismdev opened this issue Sep 2, 2021 · 2 comments

Comments

@elvismdev
Copy link

Hello,

I'm interested to use this package on one of my projects to fetch PubMed publications.

As an example use case, I'll need to retrieve publications with a given terms query, similarly how this page does: https://pubmed.ncbi.nlm.nih.gov/?term=((Winzeler+EA+OR+Winzeler+E)+AND+(Fidock+D+OR+Wirth+D+OR+Goldberg+D+OR+Llinas+M+OR+Lee+MCS+OR+Niles+J+OR+Baragana+B))

Would you be able to provide me a basic example on how I can get started to run a query like this ^ using the library?

Thanks and highly appreciated!

@XavRsl
Copy link
Collaborator

XavRsl commented Sep 2, 2021

Hi,

I'm afraid this package won't work for your use case. This package allows searching for specific IDs (PubMed, BioRxiv, DOI...) in different APIs (DOI, Crossref, ...) and outputs a JSON response.

Sorry!

Xavier

@elvismdev
Copy link
Author

@XavRsl Thanks for the clarification! I think I noted that yesterday after figuring out how the library works, but wanted to make sure I'm in the right direction. I was able to put this code together and realized it is intended to fetch a single article by his ID.

// ...
use \PubPeerFoundation\PublicationDataExtractor\Fetcher as PubPeerService;
use \PubPeerFoundation\PublicationDataExtractor\Identifiers\Pubmed as PubMedIdentifier;
// ...
$this->pps_instance = new PubPeerService( new PubMedIdentifier( '34412521' ) );
print_r('<pre>');
print_r( $this->pps_instance->fetch() );
print_r('</pre>');
die; 
// ...

Besides from that, and looking at my use case, is that something you guys plan to add in the near future? I guess I'm looking something like what this wrapper does: https://github.com/tmpjr/pubmed

// Search By Term
$api = new PubMed\Term();
$api->setReturnMax(100); // set max returned articles, defaults to 10
$articles = $api->query('CFTR');
print_r($articles);

My only concern with using it is that it hasn't been maintained for a while now. Yours seems is being kept well maintained and with recent updates.

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