Merged changes from master

This commit is contained in:
Brian O'Donnell
2015-07-06 20:32:19 -04:00
parent 34475890a9
commit c86e165726
+10 -8
View File
@@ -281,11 +281,12 @@ sub get_feed_items {
# extract image link and hover text if it exists
if( defined $item->{'description'} ){
if( $item->{'description'} =~ / src="(https?:\/\/[^"]+)/ ){
$image = $1 if defined $1;
if( $item->{'description'} =~ / title="([^"]+)/ ){
$image_title = $1 if defined $1;
}
$item->{'description'} =~ / src='(https?:\/\/[^']+)/ unless $item->{'description'} =~ / src="(https?:\/\/[^"]+)/;
if( defined $1 ){
$image = $1;
$item->{'description'} =~ / title='([^']+)/ unless $item->{'description'} =~ / title="([^"]+)/;
$image_title = $1 if defined $1;
}
}
@@ -356,6 +357,7 @@ sub decode_feed{
}
$item->{'category'} = $entries->{'category'} if defined $entries->{'category'};
$item->{'description'} = $entries->{$guid}->{'summary'}->{'content'} if defined $entries->{$guid}->{'summary'} and defined $entries->{$guid}->{'summary'}->{'content'};
push( @list, $item ) if defined $item->{'link'} and defined $item->{'title'};
}
@@ -542,10 +544,10 @@ sub usage {
print "$0\n";
print "usage:\n";
print " -a --aspect-id <id> Aspects to share with. May specify multiple times (default: 'public')\n";
print " -b --embed-image Embed an image in the post if a link exists (default: off)\n";
print " -b --embed-image Embed an image in the post if a link exists (default: off)\n";
print " -c --category-tags Attempt to automatically hashtagify RSS item 'categories' (default: off)\n";
print " -d --database <sqlite file> The SQLite file to store feed data (default: 'feed.db')\n";
print " -e --title-tags Automatically hashtagify RSS item title\n";
print " -e --title-tags Automatically hashtagify RSS item title\n";
print " -f --feed-url <http://...> The feed URL\n";
print " -g --user-agent <string> Use this to spoof the user-agent if the feed blocks bots (ex: 'Mozilla/5.0')\n";
print " -i --feed-id <string> An arbitrary identifier to associate database entries with this feed\n";
@@ -557,7 +559,7 @@ sub usage {
print " -t --auto-tag <#hashtag> Hashtags to add to all posts. May be specified multiple times (default: none)\n";
print " -u --username <user> The D* login username\n";
print " -w --post-raw-link Post the raw link instead of hyperlinking the article title (default: off)\n";
print " -x --limit <n> Only post n items per script run, to prevent post-spamming (default: no limit)\n";
print " -x --limit <n> Only post n items per script run, to prevent post-spamming (default: no limit)\n";
print "\n";
exit;