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

Commands for making authenticated API calls #50

Open
simonw opened this issue Sep 17, 2020 · 7 comments
Open

Commands for making authenticated API calls #50

simonw opened this issue Sep 17, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Collaborator

simonw commented Sep 17, 2020

Similar to twitter-to-sqlite fetch, see dogsheep/twitter-to-sqlite#51

@simonw simonw added the enhancement New feature or request label Sep 17, 2020
@simonw
Copy link
Collaborator Author

simonw commented Sep 17, 2020

I'm going to start with github-to-sqlite get and github-to-sqlite post - I may add put and suchlike later on.

@simonw
Copy link
Collaborator Author

simonw commented Sep 17, 2020

I'd like a --paginate option that does the same thing as https://github.com/simonw/paginate-json

simonw added a commit that referenced this issue Sep 17, 2020
@simonw
Copy link
Collaborator Author

simonw commented Sep 17, 2020

@simonw
Copy link
Collaborator Author

simonw commented Sep 17, 2020

Fun demo of the --nl option:

github-to-sqlite get /users/simonw/repos --paginate --nl | sqlite-utils insert simonw.db repos - --nl

@simonw
Copy link
Collaborator Author

simonw commented Sep 17, 2020

Bug with endpoints that return dictionaries rather than arrays:

github-to-sqlite get /users/simonw
[
    "login",
    "id",
    "node_id",
    "avatar_url",
    "gravatar_id",
    "url",
    "html_url",
    "followers_url",
    "following_url",
    "gists_url",
    "starred_url",
    "subscriptions_url",
    "organizations_url",
    "repos_url",
    "events_url",
    "received_events_url",
    "type",
    "site_admin",
    "name",
    "company",
    "blog",
    "location",
    "email",
    "hireable",
    "bio",
    "twitter_username",
    "public_repos",
    "public_gists",
    "followers",
    "following",
    "created_at",
    "updated_at"
]

@simonw
Copy link
Collaborator Author

simonw commented Sep 17, 2020

It would be useful if you could pass an --accept option to this.

simonw added a commit that referenced this issue Oct 19, 2020
@simonw
Copy link
Collaborator Author

simonw commented Oct 19, 2020

Demo of --accept:

github-to-sqlite get /repos/simonw/datasette/readme --accept 'application/vnd.github.VERSION.html'

simonw added a commit that referenced this issue Oct 19, 2020
Refs #50 and #52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant