←  Programs

ComputerCraft | Programmable Computers for Minecraft

»

PCan - Local Pastebin Client

LDDestroier's Photo LDDestroier 12 Jan 2016

I've been doing this for a few days, and it's in a pretty good state as of now. It can't do everything however...yet...

Have you ever wanted to design fully 3D games in CC?

No? Then this is for you!

Pcan

As in 'pastecan'


pastebin get w8RHW808 pcan
std pb w8RHW808 pcan
std ld pcan <filename>

This is a pastebin client that you can use on CC computers! First you log in to your pastebin account, then you can create AND delete pastes on your account!
If you don't have a pastebin account, however, then get one.
Don't want one? You can create pastes as guest as well.

There are two main menus: one showing your pastes (if you logged in), and one showing the trendy pastes. You can toggle between the two with 'T'.
You can create a new paste with 'C', and look at a paste (via paste ID) with 'F".
I integrated my 'less' command into this, so you can view the pastes more efficiently than with the basic 'edit' command! I also needed it modified, so that's why it doesn't automatically download separately.
In the 'less' menu, you can remove a paste you own, and download any paste. I tried adding an edit option, but that can't be done with the API as far as I know.

To select an item on the menu, press a number button 1-9. Clicking is hard.
Edited by LDDestroier, 12 January 2016 - 06:54 PM.
Quote

Creator's Photo Creator 12 Jan 2016

For editing, you download, edit, upload.
Quote

LDDestroier's Photo LDDestroier 12 Jan 2016

View PostCreator, on 12 January 2016 - 06:27 PM, said:

For editing, you download, edit, upload.

But if I upload, doesn't it give it a different, random id?
Quote

Creator's Photo Creator 12 Jan 2016

Isnt there an API call for editing a paste, like we can edit pastes in the browser? (That is what I meant.)
Quote

LDDestroier's Photo LDDestroier 13 Jan 2016

View PostCreator, on 12 January 2016 - 07:25 PM, said:

Isnt there an API call for editing a paste, like we can edit pastes in the browser? (That is what I meant.)

Ehh? I don't know how to go about figuring out what to actually put in the program. If you know how, mind making an edit function for me?
Quote

Lemmmy's Photo Lemmmy 15 Jan 2016

View PostCreator, on 12 January 2016 - 07:25 PM, said:

Isnt there an API call for editing a paste, like we can edit pastes in the browser? (That is what I meant.)

There isn't an API call for it that is supported by pastebin, so you would have to feign a session to do this.
Edited by Lemmmy, 15 January 2016 - 05:23 PM.
Quote

LDDestroier's Photo LDDestroier 16 Jan 2016

View PostLemmmy, on 15 January 2016 - 05:22 PM, said:

View PostCreator, on 12 January 2016 - 07:25 PM, said:

Isnt there an API call for editing a paste, like we can edit pastes in the browser? (That is what I meant.)

There isn't an API call for it that is supported by pastebin, so you would have to feign a session to do this.

I dunno how to do that...

Oh, and since the first post, I polished up the display a bit and modified some stuff and whatnot.
Quote

Waitdev_'s Photo Waitdev_ 16 Jan 2016

awesome idea :) i've tried to use the pastebin api, but completely failed. you've nailed it ;3

(offtopic)
why do i want to create a program called pastecan't?
Quote

LDDestroier's Photo LDDestroier 16 Jan 2016

View PostWait_, on 16 January 2016 - 04:18 AM, said:

(offtopic)
why do i want to create a program called pastecan't?

Because Genesis does what pastecan't!
Quote

Lemmmy's Photo Lemmmy 17 Jan 2016

View PostLDDestroier, on 16 January 2016 - 04:10 AM, said:

View PostLemmmy, on 15 January 2016 - 05:22 PM, said:

View PostCreator, on 12 January 2016 - 07:25 PM, said:

Isnt there an API call for editing a paste, like we can edit pastes in the browser? (That is what I meant.)

There isn't an API call for it that is supported by pastebin, so you would have to feign a session to do this.

I dunno how to do that...

Oh, and since the first post, I polished up the display a bit and modified some stuff and whatnot.

I wouldn't feign a session, you would need to have fun with http.request and it may only work for one person on a server.
Quote

LDDestroier's Photo LDDestroier 26 Jan 2016

View PostLemmmy, on 17 January 2016 - 01:32 AM, said:

View PostLDDestroier, on 16 January 2016 - 04:10 AM, said:

View PostLemmmy, on 15 January 2016 - 05:22 PM, said:

View PostCreator, on 12 January 2016 - 07:25 PM, said:

Isnt there an API call for editing a paste, like we can edit pastes in the browser? (That is what I meant.)

There isn't an API call for it that is supported by pastebin, so you would have to feign a session to do this.

I dunno how to do that...

Oh, and since the first post, I polished up the display a bit and modified some stuff and whatnot.

I wouldn't feign a session, you would need to have fun with http.request and it may only work for one person on a server.

...does that mean it's (for now) impossible?
Quote

Creator's Photo Creator 26 Jan 2016

Also, for non pro pastebin accounts, only one session is allowed at any given moment. This means that we will be disconnected from the browser session.
Quote

Wojbie's Photo Wojbie 26 Jan 2016

Well if you are thinking about bypassing API and faking session for editing you might as well add private paste downloading.
Quote