Xion / gisht

Gists in the shell
GNU General Public License v2.0
27 stars 0 forks source link

Add dpaste.com #27

Open Xion opened 6 years ago

Xion commented 6 years ago

This shouldn't be confused with dpaste.de which is different and already implemented :)

dpaste.com looks like a Basic gist, with simple URL patterns for both HTML and raw URLs.

Atul9 commented 6 years ago

I would like to this up. Can you please share some more details of what and how it is to be implemented? I am new to Rust and this project.

Xion commented 6 years ago

Hey! Thanks for picking this up :)

I recommend you start by both looking at the Basic type (https://github.com/Xion/gisht/blob/master/src/hosts/common/basic.rs) and at least one existing Host that uses the Basic abstraction directly, like https://github.com/Xion/gisht/blob/master/src/hosts/lpaste.rs. It mostly boils down to following the same style of invoking Basic::new, but with URL patterns that are specific to dpaste.com (which you should be able to glean by just creating a dpaste.com gist, looking at the URL bar in the browser, inspecting the HTML of the gist page, etc.).

Oh, and don't worry about writing tests too much. In the example host linked above, they are really pretty redundant. I'll likely remove all such tests in the future. Just try your implementation against a dpaste.com gist with some complete script (I typically use:

#!/bin/sh
echo "hello world"

)

Let me know if you need more help getting around the project. For Rust assistance in general, check the IRC channels (https://www.rust-lang.org/en-US/community.html).