6 ms·
Author here. - Please use a desktop browser (Chrome preferred). While mobile browsers kinda-sorta work if you're just clicking through the examples, keyboard i
by tubelite 12y ago
Author here.
- Please use a desktop browser (Chrome preferred). While mobile browsers kinda-sorta work if you're just clicking through the examples, keyboard input doesn't work on mobiles (yet).
- Pigshell has few users (in fact, using the plural is a slight marketing exaggeration) so please bear with me for any teething issues, broken links, inadequate documentation...
- One of the practical use cases is copying files across Google accounts, and backing it up to your desktop. (Details here: http://pigshell.com/v/0.6.2/doc/gdrive.html http://pigshell.com/v/0.6.2/doc/gdrive.html) The nice thing about a unix approach is that the exact same cp command can be used to copy GDrive to Dropbox, or any other supported filesystem.
- Some more D3 visualization examples here, using Mike Bostock's gist viewer: http://bl.ocks.org/ganeshv http://bl.ocks.org/ganeshv (Do use the "Open in a new window" links, like this one: http://bl.ocks.org/ganeshv/raw/46cc526d41d16995ccdc/ http://bl.ocks.org/ganeshv/raw/46cc526d41d16995ccdc/).
- sprayk 12y agoI looked through the four documentation links on the right and was unable to find out how to cat a Google spreadsheet as anything consumable by the shell. I took a guess and tried cat -o gdrive.fmt=txt and csv, but those were not fruitful. Is this possible currently? edit: found mimeMap.js and saw tsv was an option. That didn't work either.
- tubelite 12y agoIIRC the Drive API does not support those conversion options. The way forward would be for an xlsx parsing JS library to convert it into CSV or a stream of Javascript objects. I didn't find any GPL-compatible library last time I checked. See https://developers.google.com/drive/web/manage-downloads https://developers.google.com/drive/web/manage-downloads for a list of export format possibilities. For spreadsheets, the only options are xlsx, odt and pdf.
- deleted 12y ago[deleted]
- fiatjaf 12y agoGoogle Drive document can be embedded as iframes. Wouldn't this solve this problem? Here's a proof: http://www.cellmaster.com.au/example.html http://www.cellmaster.com.au/example.html
- hbbio 12y agoGood work, congrats! I played with the same idea a few years ago, but never went that far :) cf. https://github.com/hbbio/webshell https://github.com/hbbio/webshell
- gmaster1440 12y agoAre write operations possible with pigshell? If I connected my Facebook account and want to post a new status update or add a picture to an album, it doesn't seem like I can do something like this: pig> echo "Testing status update" >> /facebook/me/posts
- tubelite 12y agoThat should be echo "Testing status update" > /facebook/me/posts/ I tried it and it WorksForMe (TM) That said, two caveats: - The FB filesystem hasn't been worked on in 1+ year. - AFAIK v2 of the graph API will become mandatory sometime next year and does not allow apps to get lists of friends. Friend list returns only friends who also use the same app... which is pretty disappointing.
- daveloyall 12y agoTrailing slash?
- tubelite 12y agoFitting web apis into a filesystem metaphor isn't always straightforward. For instance, it is common to POST into a container URI (which we represent as a directory) and have no control over the name or id of the object which is created. This is the case with Facebook posts. echo "foo" > /facebook/me/posts would imply overwriting the posts directory, which is not allowed (either on pigshell or on unix) OTOH, asking the user to do a echo foo >/facebook/me/posts/post-11oct2014 sets up the expectation that the post will be named that way, when it will most likely be a long numeric id. Thus, the trailing slash. Not perfect, but the best compromise I could think of.
- pb2au 12y agoThe great-grandparent suggested: echo "Testing status update" >> /facebook/me/posts I think appending content to a file path (with or without the trailing slash) is clearer than the analogy of a truncating write to a directory path (where the trailing slash is required). The current model seems similar to the REST interpretation of CRUD, where > equates to 'create' and >> to 'update', and creating a resource is done at the collection URL. Nothing wrong with this, but it seems slightly unintuitive to me. My suggested mapping would be: >/facebook/me/posts - Unsupported (or delete all posts, and make a new one) >>/facebook/me/posts - Add a new facebook post >/facebook/me/posts/long_numeric_id - Update post (truncate) >>/facebook/me/posts/long_numeric_id - Update post (append) In this case, both > and >> are context dependent, but more flexible. Would this strategy mesh well with the rest of the implementation? Also, nice work! The project reminds me of Plan 9's /net.
- fsiefken 12y agoHi tubelite, on mobile safari and chrome IOS7.04 with an ipad the keyboard comes up after I clicked on this example command: pig:/$ cat http://pigshell.com/sample/photos/bchips.jpg http://pigshell.com/sample/photos/bchips.jpg I can type in stuff and after enter the keyboard disappears again. A external bluetooth keyboard might work.
- tubelite 12y agoYes, that happens, but it is awkward and unreliable. The CLI is a CodeMirror instance (version 2.something), which has known issues with iOS. I need to check if later versions work better on iOS.