Created
April 4, 2019 23:11
-
-
Save matoken/4f346ee2fc338c1f66041d36307bb63f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use HTML::Entities; | |
use Encode qw/encode decode/; | |
print "Content-Type: application/atom+xml; charset=utf-8\n\n"; | |
my $URL= 'https://gnusocial.matoken.org/api/statuses/user_timeline/2.atom'; | |
my @cont = `wget -q -O - $URL`; | |
foreach my $data(@cont){ | |
$data = decode('UTF-8',$data); | |
if(( $data !~ /matoken.org\/blog\// ) && | |
( $data !~ /\#kagolug/ ) && | |
( $data =~ / <content type="html">/ )){ | |
# print encode('UTF-8',$data); | |
$data =~ s/^.*>(.*)<.*$/$1/; | |
$data = decode_entities($data); | |
$data =~ s/"/"/g; | |
$data =~ s/</</g; | |
$data =~ s/>/>/g; | |
$data =~ s/<.*?>//g; | |
$data = substr($data,0,64); | |
$data = ' <content type="html">' . $data . "</content>\n"; | |
# print encode('UTF-8',"$data\n"); | |
} | |
print encode('UTF-8',$data); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment