mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
02_RSS: use a GUID in RSS; urlq source for img command
git-svn-id: https://svn.fhem.de/fhem/trunk@6983 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
369ad2e219
commit
a0348d73a8
@ -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.
|
||||
- change: 02_RSS: use a GUID in RSS; urlq source for img command
|
||||
- feature: 70_PushNotifier improve usebility, configuration without cURL (xusader)
|
||||
- bugfix: SYSMON: prevent empty line im log by userReadings
|
||||
- feature: 10_IT empfang (by bjoernh)
|
||||
|
@ -218,7 +218,8 @@ RSS_returnRSS($) {
|
||||
my $url= RSS_getURL($defs{$name}{fhem}{hostname});
|
||||
my $type = $defs{$name}{fhem}{style};
|
||||
my $mime = ($type eq 'png')? 'image/png' : 'image/jpeg';
|
||||
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'/></item></channel></rss>";
|
||||
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>";
|
||||
|
||||
return ("application/xml; charset=utf-8", $code);
|
||||
}
|
||||
@ -363,8 +364,13 @@ RSS_itemImg {
|
||||
return unless(defined($arg));
|
||||
return if($arg eq "");
|
||||
my $I;
|
||||
if($srctype eq "url" || $srctype eq "urlq") {
|
||||
my $data;
|
||||
if($srctype eq "url") {
|
||||
my $data = GetFileFromURL($arg,3,undef,1);
|
||||
$data= GetFileFromURL($arg,3,undef,1);
|
||||
} else {
|
||||
$data= GetFileFromURLQuiet($arg,3,undef,1);
|
||||
}
|
||||
if($imgtype eq "gif") {
|
||||
$I= GD::Image->newFromGifData($data);
|
||||
} elsif($imgtype eq "png") {
|
||||
@ -986,8 +992,8 @@ RSS_CGI(){
|
||||
<li>img <x> <y> <['w' or 'h']s> <imgtype> <srctype> <arg> <br>Renders a picture at the
|
||||
position (<x>, <y>). The <imgtype> is one of <code>gif</code>, <code>jpeg</code>, <code>png</code>.
|
||||
The picture is scaled by the factor <s> (a decimal value). If 'w' or 'h' is in front of scale-value the value is used to set width or height to the value in pixel. If <srctype> is <code>file</code>, the picture
|
||||
is loaded from the filename <arg>, if <srctype> is <code>url</code>, the picture
|
||||
is loaded from the URL <arg>, if <srctype> is <code>data</code>, the picture
|
||||
is loaded from the filename <arg>, if <srctype> is <code>url</code> or <code>urlq</code>, the picture
|
||||
is loaded from the URL <arg> (with or without logging the URL), if <srctype> is <code>data</code>, the picture
|
||||
is piped in from data <arg>. You can use
|
||||
<code>{ <a href="#perl"><perl special></a> }</code> for <arg>. See below for example.
|
||||
Notice: do not load the image from URL that is served by fhem as it leads to a deadlock.<br></li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user