This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
LDDestroier's profile picture

PCan - Local Pastebin Client

Started by LDDestroier, 12 January 2016 - 04:58 PM
LDDestroier #1
Posted 12 January 2016 - 05:58 PM
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 on 12 January 2016 - 05:54 PM
Creator #2
Posted 12 January 2016 - 06:27 PM
For editing, you download, edit, upload.
LDDestroier #3
Posted 12 January 2016 - 06:53 PM
For editing, you download, edit, upload.

But if I upload, doesn't it give it a different, random id?
Creator #4
Posted 12 January 2016 - 07:25 PM
Isnt there an API call for editing a paste, like we can edit pastes in the browser? (That is what I meant.)
LDDestroier #5
Posted 13 January 2016 - 12:31 AM
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?
Lemmmy #6
Posted 15 January 2016 - 05:22 PM
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 on 15 January 2016 - 04:23 PM
LDDestroier #7
Posted 16 January 2016 - 04:10 AM
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.
Waitdev_ #8
Posted 16 January 2016 - 04:18 AM
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?
LDDestroier #9
Posted 16 January 2016 - 07:03 PM
(offtopic)
why do i want to create a program called pastecan't?

Because Genesis does what pastecan't!
Lemmmy #10
Posted 17 January 2016 - 01:32 AM
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.
LDDestroier #11
Posted 26 January 2016 - 05:49 PM
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?
Creator #12
Posted 26 January 2016 - 06:29 PM
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.
Wojbie #13
Posted 26 January 2016 - 07:03 PM
Well if you are thinking about bypassing API and faking session for editing you might as well add private paste downloading.