Skip to content

Commit

Permalink
revert to HTML scraping for dpaste.org
Browse files Browse the repository at this point in the history
  • Loading branch information
grawity committed Dec 15, 2020
1 parent 1bb39be commit e0b55ed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License (also available at <https://spdx.org/licenses/MIT>)

(c) 2010–2016 Mantas Mikulėnas <grawity@gmail.com>
(c) 2010–2020 Mantas Mikulėnas <grawity@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
17 changes: 16 additions & 1 deletion getpaste
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,16 @@ sub dl_dgl_pastesh {
return $data;
}

sub dl_dpaste {
my ($url, $frag) = @_;

my $body = get($url);
if ($body =~ m{<textarea id="copySnippetSource">(.+?)</textarea>}) {
return decode_html($1);
}
return;
}

sub dl_ezcrypt {
eval {
require Crypt::Digest::SHA1;
Expand Down Expand Up @@ -1216,10 +1226,15 @@ sub dl_zerobin {
to_path => "#0.txt",
},
{
host => ["dpaste.org", "dpaste.de"],
host => "dpaste.de",
path => qr!^/\w+!,
to_path => "#0/raw/",
},
{
host => "dpaste.org",
path => qr!^/\w+!,
parser => \&dl_dpaste,
},
{
host => "www.dropbox.com",
to_host => "dl.dropboxusercontent.com",
Expand Down

0 comments on commit e0b55ed

Please sign in to comment.