Rewrite the paste logic to use customizable and configurable pastebin services through configuration files, fixing #312. As a showcase, this PR adds support for http://fpaste.org quite painlessly in a7bf3a73b85aa8b136aa6905c2ec0905d111f76f.
**Disclaimer:** this has not yet been tested under Windows, and I suspect that looking up the path to the system configuration directory holding the pastebin service configurations shipped with the plugin might not work. This should be tested. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany-plugins/pull/338
-- Commit Summary --
* geniuspaste: Fix a memory leak * geniuspaste: Rewrite to use configurable pastebins * geniuspaste: Restore configuration compatibility with previous version * geniuspaste: Simplify getting the paste title * geniuspaste: Use constants instead of direct string lookup * geniuspaste: Show request and response in debug mode * geniuspaste: Add fpaste.org support * geniuspaste: Remove unused code
-- File Changes --
M build/geniuspaste.m4 (1) M geniuspaste/Makefile.am (2) M geniuspaste/README (106) A geniuspaste/data/Makefile.am (11) A geniuspaste/data/codepad.org.conf (34) A geniuspaste/data/dpaste.de.conf (64) A geniuspaste/data/fpaste.org.conf (67) A geniuspaste/data/pastebin.geany.org.conf (35) A geniuspaste/data/sprunge.us.conf (88) A geniuspaste/data/tinypaste.com.conf (20) M geniuspaste/src/Makefile.am (2) M geniuspaste/src/geniuspaste.c (755)
-- Patch Links --
https://github.com/geany/geany-plugins/pull/338.patch https://github.com/geany/geany-plugins/pull/338.diff
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/338
Fixed a few details and added a neat feature while trying to add support for http://paste.debian.net/ (a459a192f62ad21b02f353fb6a7e8d2e5111b94c): support for using the pastebin service's HTTP redirection response as paste URL (649939a4490034e51ff69e02d5380f8b7664d882). It's a lot neater than grepping some more or less random web page when using a non-API pastebin (e.g. when simulating a browser rather than using a well defined API).
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/338#issuecomment-172275096
@@ -0,0 +1,20 @@ +# FIXME: outdated, this leads to a 404 on http://pasted.co/
Yes, this doens't work. It didn't before my changes either, I guess the service changed since it was implemented. I couldn't find how to use it, and their link to a supposed API documentation leads to a 404.
I'd delete this pastebin configuration altogether if I was the only caller, but for now I kept it in the hope maybe someone knows how to fix it.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/338/files#r49938936
@@ -0,0 +1,20 @@ +# FIXME: outdated, this leads to a 404 on http://pasted.co/
So in the end, it's merely ported from the previous hard-coded logic, with zero testing :)
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/338/files#r49938940
Looks fine to me. Once @Enrix835 is giving ok, I'd like to merge it.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/338#issuecomment-173013238
Merged #338.
--- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/338#event-558170322
github-comments@lists.geany.org