Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GeniusPaste] Rewrite to make pastebins customizable #338

Merged
merged 14 commits into from
Feb 21, 2016

Conversation

b4n
Copy link
Member

@b4n b4n commented Jan 16, 2016

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 a7bf3a7.

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.

b4n added 8 commits January 14, 2016 20:27
Rewrite the paste logic to support configurable pastebin services.
Previously supported pastebin services are ported to the new format.

This may break user configuration as it will reset the pastebin service
in use to the new default.

Closes geany#312.
Use constants instead of direct strings for pastebin service
configuration lookup to lower the risk of typos.
This eases debugging a faulty pastebin configuration by showing the
actual data sent and received.
@frlan frlan added this to the 1.27 milestone Jan 16, 2016
b4n added 6 commits January 17, 2016 00:19
Most non-API-based pastebin services will redirect the client to the
newly created paste page.  It is then safer to use the redirect URI
than trying to parse some possibly complex HTML to extract the URI.
The request and response might be sensibly different, and their
respective URI especially matters, so log them both separately.
@b4n
Copy link
Member Author

b4n commented Jan 16, 2016

Fixed a few details and added a neat feature while trying to add support for http://paste.debian.net/ (a459a19): support for using the pastebin service's HTTP redirection response as paste URL (649939a). 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).

@@ -0,0 +1,20 @@
# FIXME: outdated, this leads to a 404 on http://pasted.co/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in the end, it's merely ported from the previous hard-coded logic, with zero testing :)

@frlan
Copy link
Member

frlan commented Jan 19, 2016

Looks fine to me. Once @Enrix835 is giving ok, I'd like to merge it.

frlan added a commit that referenced this pull request Feb 21, 2016
[GeniusPaste] Rewrite to make pastebins customizable
@frlan frlan merged commit 79fc1fa into geany:master Feb 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants