maximed / gost Goto Github PK
View Code? Open in Web Editor NEWA gist client in go
License: MIT License
A gist client in go
License: MIT License
Gost should handle gists updating.
http://developer.github.com/v3/gists/#edit-a-gist
-u
flag should be used for updating.
By default if a gist contains multiple files and some of them are not listed in -u
params, they should remain.
Gost should allow downloading of gist based on it's id
gost -g <gist_id>
Api provides a GET
method to do so:
http://developer.github.com/v3/gists/#get-a-single-gist
When we want do delete a gist, we can do
gost -D b9603076d61bb5287b52
But this will fail if full url is passed eg.
gost -D https://gist.github.com/b9603076d61bb5287b52
gost should be able to handle both.
Creating gists is one thing but deleting them can also be usefull.
A user should be able to give the id of a gist he would like to see removed.
The API accepts a DELETE method to do so: http://developer.github.com/v3/gists/#delete-a-gist
I just updated to the latest with 2fa and now I have another UX suggestion.
When I'm done creating a Gist it would be good UX to copy the resulting URL to the clipboard or auto open in browser.
Thoughts?
Many errors check are done like this:
if err != nil {
// handle it
} else {
// handle success case
}
whereas a simple:
if err != nil {
// handle error
}
// handle success case
is enough.
#27 handles deleting a gist by passing either it's id, either the full url.
But this has not been done for other actions like update or download.
I have 2fa setup and when first creating a gist I get asked to setup my conf file, but the file is empty.
When trying to upload multiple files with same name, ex foo/name
and bar/name
, only one will be uploaded. This is because gist won't accept having same name for multiple files.
A solution could be to to rename files to something like foo_name
and bar_name
but only if there is a conflict in naming.
gist_json.go
is a mess, it mixes CamelCase and snake_case and it reflects in other packages that uses it.
CamelCase should be use everywhere.
Currently, if you try to initialize gost and already have an API key for it (from a previous installation), it will not try to replace or add a new one, but instead fail and post the first gist as 'anonymous'.
Here's an example of what the official ruby gist does, and what I think is the ideal situation for me at least:
I don't have time to contribute patches (sorry!) so I hope this bug report will be sufficient.
Thanks for the great program!
For users who have enable two factor identification, OAuth login will fail.
gost
should implement it, or at least display a warning message if two factor identification is not supported.
For API documentation, see:
http://developer.github.com/v3/auth/#working-with-two-factor-authentication
When running only gost
withouth any arguments, nothing is displayed.
Hence a user won't know how to use the program. Some hints should be given to help hiw finding out how to use gost
.
After a gist has been created or updated, the default browser should open on the resulting url. This should not be a default behaviour, but an option that could be supplied through command line.
REL #15
It seems (?) the JSON served by github.com has changed. I had to modify a field-tag in gist_json.go, type FileDetails, to make download work again. See patch below:
diff --git a/json/gist_json.go b/json/gist_json.go
index f1d66d9..5c77a0c 100644
--- a/json/gist_json.go
+++ b/json/gist_json.go
@@ -48,7 +48,7 @@ type File struct {
}
type FileDetails struct {
- FileName string `json:"file_name"`
+ FileName string `json:"filename"`
Type string `json:"type"`
Language string `json:"language"`
RawUrl string `json:"raw_url"`
After posting a gist, the resulting url should be copied to clipboard. This way, a user won't have to copy it before.
Default copy commands could be find in defunkt's gist.
REL: #15
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.