mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
02_RSS: new attribute itemtitle
git-svn-id: https://svn.fhem.de/fhem/trunk@10813 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
61be4055f1
commit
75dc9a07e2
@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- feature: 02_RSS: new attribute itemtitle
|
||||
- bugfix: 57_Calendar: weekly recurring events on several weekdays, that
|
||||
start around midnight
|
||||
- bugfix 49_SSCAM: fixed a problem that a usersession won't be destroyed
|
||||
|
@ -34,7 +34,8 @@ my @valid_halign = qw(left center right justified);
|
||||
# use vars qw($FW_cname); # Current connection name
|
||||
|
||||
# http://blogs.perl.org/users/mike_b/2013/06/a-little-nicer-way-to-use-smartmatch-on-perl-518.html
|
||||
no if $] >= 5.017011, warnings => 'experimental::smartmatch';
|
||||
#no if $] >= 5.017011, warnings => 'experimental::smartmatch';
|
||||
no if $] >= 5.017011, warnings => 'experimental';
|
||||
|
||||
#########################
|
||||
sub
|
||||
@ -56,7 +57,7 @@ RSS_Initialize($) {
|
||||
$hash->{DefFn} = "RSS_Define";
|
||||
$hash->{UndefFn} = "RSS_Undefine";
|
||||
#$hash->{AttrFn} = "RSS_Attr";
|
||||
$hash->{AttrList} = "size bg bgcolor tmin refresh areas autoreread:1,0 viewport noscroll";
|
||||
$hash->{AttrList} = "size itemtitle bg bgcolor tmin refresh areas autoreread:1,0 viewport noscroll";
|
||||
$hash->{SetFn} = "RSS_Set";
|
||||
$hash->{NotifyFn} = "RSS_Notify";
|
||||
|
||||
@ -247,7 +248,9 @@ RSS_returnRSS($) {
|
||||
my $type = $defs{$name}{fhem}{style};
|
||||
my $mime = ($type eq 'png')? 'image/png' : 'image/jpeg';
|
||||
my $now = time();
|
||||
my $code = "<rss version='2.0' xmlns:media='http://search.yahoo.com/mrss/'><channel><title>$name</title><ttl>1</ttl><item><media:content url='$url/rss/$name.$type' type='$mime'/><guid isPermaLink='false'>item_$now</guid></item></channel></rss>";
|
||||
my $itemTitle = AttrVal($name, "itemtitle", "");
|
||||
my $titleTag = ($itemTitle ne '')? '<title>'.$itemTitle.'</title>' : '';
|
||||
my $code = "<rss version='2.0' xmlns:media='http://search.yahoo.com/mrss/'><channel><title>$name</title><ttl>1</ttl><item>$titleTag<media:content url='$url/rss/$name.$type' type='$mime'/><guid isPermaLink='false'>item_$now</guid></item></channel></rss>";
|
||||
|
||||
return ("application/xml; charset=utf-8", $code);
|
||||
}
|
||||
@ -1018,6 +1021,8 @@ plotFromUrl(@)
|
||||
<li>areas<br>HTML code that goes into the image map.<br>
|
||||
Example: <code>attr FrameRSS areas <area shape="rect" coords="0,0,200,200" href="http://fhem.de"/><area shape="rect" coords="600,400,799,599" href="http://has:8083/fhem" target="_top"/></code>
|
||||
</li><br>
|
||||
<li>itemtitle</br>Adds a title tag to the RSS item that contains the specified text.
|
||||
</li><br>
|
||||
</ul>
|
||||
<br><br>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user