Articles
List articles
To list all articles and display the doi, (internal) id,
title, url, and published:sub:`date` for each, issue:
pigshare list_articles
To display a table with all articles, but only display doi and
title, you can use:
pigshare -o doi,title list_articles
Read an article
To display the properties of an article, use:
pigshare read_article [article_id]
To display the doi and all tags of a number of articles, use (tags are
not part of the ‘short’ article format that the
list:sub:`articles` command returns):
pigshare -o doi,tags read_article [article_id] [article_id] [article_id]
Search for articles
To list all articles matching a search string, issue:
pigshare search_articles --search_term [search_term]
To display all dois and titles of articles that match a search string:
pigshare -o doi,title search_articles --search_term [search_term]
List my articles
To list all of your own articles:
pigshare list_my_articles
To create a new article
pigshare create_article --article '{"title": "Markus test", "custom_fields": {"key1": "value"}}'
Or, if you want pigshare to ask your input for every one of the
fields:
pigshare create_article
Upload one (or more files) for an article
pigshare upload_new_file --id [article_id] file1 [file2 ... ...]
Statistics
Statistics can be queried as totals, timeline, or breakdown.
Documentation can be found here:
stats:sub:`apidoc <https://github.com/figshare/user_documentation/blob/master/Stats/index.md>`__
Pigshare follows the api methods pretty closely, so you should be able
to figure out how it works yourself fairly easily.
An example call to get the total number of views for an article (that
was published in an institutional figshare, omit the -i parameter if
that was not the case):
pigshare -i auckland get_total_article_views 2075410
{
"2075410": {
"totals": 204
}
}
Total views for an author:
pigshare get_total_author_views 117523
{
"1175235": {
"totals": 481
}
}
Breakdown of downloads for an institutional article, by day:
pigshare -i auckland get_breakdown_article_downloads --granularity day 2075410
{
"2075410": {
"breakdown": {
"2016-05-06": {
"United States": {
"Mountain View": 1,
"total": 1
}
},
"2016-05-10": {
"New Zealand": {
"Auckland": 1,
"total": 1
}
},
"2016-05-16": {
"New Zealand": {
"Auckland": 1,
"total": 1
}
}
}
}
}
A pipeline to get the total downloads of all your own articles:
pigshare -o id list_my_articles | xargs pigshare get_total_article_downloads
And so on.