Skip to content

Commit

Permalink
Item14057: fixed docu; fixed discover parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Apr 26, 2016
1 parent 841a16a commit 9af5625
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
11 changes: 6 additions & 5 deletions data/System/FeedPlugin.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="micha" comment="reprev" date="1458144340" format="1.1" reprev="2" version="3"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1461663841" format="1.1" version="1"}%
---+!! %TOPIC%
%FORMFIELD{"Description"}%

Expand All @@ -10,13 +10,13 @@ and only takes care of caching and integrating results on a Foswiki page.

---++ Examples

List headlines at http://blog.foswiki.org; auto-detect news feed:
List headlines at http://blog.foswiki.org; auto-discover news feed:

<verbatim class="tml">
%STARTSECTION{"example1"}%
%FEED{
"http://blog.foswiki.org"
detect="on"
discover="on"
header="<div class='alt'>$n"
footer="$n</div>"
}%
Expand Down Expand Up @@ -104,6 +104,7 @@ In addition the =header=, =format=, =separator= and =footer= format strings may
---++ Change History

%TABLE{columnwidths="7em" tablewidth="100%"}%
| 24 Apr 2016 | fixed docu; fixed discover mode |
| 18 Mar 2016 | be more robust on feeds not publishing proper dates |
| 16 Mar 2016 | initial release |

Expand All @@ -115,5 +116,5 @@ In addition the =header=, =format=, =separator= and =footer= format strings may
%META:FIELD{name="Repository" title="Repository" value="https://github.com/foswiki/%25$ROOTMODULE%25"}%
%META:FIELD{name="Copyright" title="Copyright" value="2016, Michael Daum, All Rights Reserved"}%
%META:FIELD{name="License" title="License" value="GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]])"}%
%META:FIELD{name="Home" title="Home" value="http://foswiki.org/Extensions/%25$ROOTMODULE%25"}%
%META:FIELD{name="Support" title="Support" value="http://foswiki.org/Support/%25$ROOTMODULE%25"}%
%META:FIELD{name="Home" title="Home" value="https://foswiki.org/Extensions/%25$ROOTMODULE%25"}%
%META:FIELD{name="Support" title="Support" value="https://foswiki.org/Support/%25$ROOTMODULE%25"}%
4 changes: 2 additions & 2 deletions lib/Foswiki/Plugins/FeedPlugin.pm
Expand Up @@ -20,8 +20,8 @@ use warnings;

use Foswiki::Func ();

our $VERSION = '1.02';
our $RELEASE = '18 Jan 2016';
our $VERSION = '1.03';
our $RELEASE = '26 Apr 2016';
our $SHORTDESCRIPTION = 'Syndication feed parser';
our $NO_PREFS_IN_TOPIC = 1;
our $core;
Expand Down
6 changes: 3 additions & 3 deletions lib/Foswiki/Plugins/FeedPlugin/Core.pm
Expand Up @@ -172,7 +172,7 @@ sub _client {
$proxy .= ':' . $port if $port;
$ua->proxy([ 'http', 'https' ], $proxy);

my $proxySkip = $Foswiki::cfg{PROXY}{SkipProxyForDomains};
my $proxySkip = $Foswiki::cfg{PROXY}{SkipProxyForDomains} || $Foswiki::cfg{PROXY}{NoProxy};
if ($proxySkip) {
my @skipDomains = split(/\s*,\s*/, $proxySkip);
$ua->no_proxy(@skipDomains);
Expand Down Expand Up @@ -217,7 +217,7 @@ sub FEED {
return _inlineError("Error: no url specified") unless $url;


my $discover = Foswiki::Func::isTrue("discover", 0);
my $discover = Foswiki::Func::isTrue($params->{discover}, 0);
if ($discover) {
my @feeds = XML::Feed->find_feeds($url);
return _inlineError("Error: no feeds found") unless @feeds;
Expand Down Expand Up @@ -260,7 +260,7 @@ sub FEED {

my $category = join(", ", $entry->category()) || '';
my $tags = join(", ", $entry->tags()) || '';
my $content = "<noautokink>".$entry->content->body()."</noautolink>";
my $content = "<noautolink>".$entry->content->body()."</noautolink>";
my $summary = $entry->summary->body();
my $issued = $entry->issued;
$issued = $issued->epoch if defined $issued;
Expand Down

0 comments on commit 9af5625

Please sign in to comment.