You are here

Fetching images into xmltv

11 posts / 0 new
Last post
Maniac
Offline
Donator
Joined: 11 years
Last seen: 9 months
Fetching images into xmltv

Hi there,
Maybe this was posted before, but I cannot find it. 
I was wondering if it is possible to alter the .ini files to fetch an image of a show or a moive poster, to include to the xmltv?
What property in the ini file should be used for such thing?
 
Thanks

WGMaker
Offline
WGMaker's picture
WG++ Team memberDonator
Joined: 12 years
Last seen: 9 hours
Is the support helpful?
support us

Hi Maniac,
 
you can use the WG++ element showicon for that. It is mentioned on the overview APPENDIX D of the manual.
The scrubbed value is added to the src attribute of the icon xmltv element. This value should be a link to the location of the picture.
 
Jan

WGMaker
Offline
WGMaker's picture
WG++ Team memberDonator
Joined: 12 years
Last seen: 9 hours
Is the support helpful?
support us

You must be using an older version of the manual, the latest has a revision date of 18/09/2013 on the front page and can be downloaded from the downoad page @ http://www.webgrabplus.com/sites/default/files/download/documentation/Ma...
 
Do you use the latest program version? Build 51 http://www.webgrabplus.com/sites/default/files/download/sw/V1.1.1/upgrad... even the beta http://www.webgrabplus.com/sites/default/files/patchexe_prebuild.zip
 
To test if the showicon is properly processed start with a fixed value like
showicon.modify {addstart|this is a test showicon}
If that works, move to the scrub , (you can add (debug) to see what going on)
 
Good luck    Jan

Maniac
Offline
Donator
Joined: 11 years
Last seen: 9 months

Thank you for your reply,
I've tryed the showicon.modify test and it showed up, but not all events, only some. is there a pattern here? 
 
But I am having problems in fetching the image url from a <img src="http://www.webgrabplus.com/%20element.%20How%20would%20the%20scrub%20code%20look%20like%20if%20I%20was%20to%20fetch%20the%20following%20image%3A_______________%3Cdiv%C2%A0class%3D"fr">

 

<img src="http://www.webgrabplus.com/%3Ca%20class%3D"webkit-html-attribute-value webkit-html-resource-link" href="http://phazer.info/img/covers/img44274-tv3948-csi-miami.jpg" target="_blank">http://phazer.info/img/covers/img44274-tv3948-csi-miami.jpg" alt="CSI: Miami - poster" title="CSI: Miami"/>

 

</div>

 

Maniac
Offline
Donator
Joined: 11 years
Last seen: 9 months

Thanks mate, got it working from your example :)
 
And a big thanks to webgrabplus for their hard work. 

Maniac
Offline
Donator
Joined: 11 years
Last seen: 9 months

One more question :)
Is it possible to fetch values that are innside a class atribute? For eksample getting a url from here:
<table style="background-image: url(http://imageurl.com/pic.jpg);" >
</table>

WGMaker
Offline
WGMaker's picture
WG++ Team memberDonator
Joined: 12 years
Last seen: 9 hours
Is the support helpful?
support us

Hi
 
if your example is correct (the <img tag has no closing /> tag ), you can do the following:
showicon.scrub {multi(include="id=\"pictureHolder\"")|<div style=|<img src="http://www.webgrabplus.com/%7C%3B">|</div>}
This scrubs all the data between <img src0"  ...    ;"> and filters it for the ones with id="pictureHolder" and results in a value for showicon of :
imgs/epg/channel/2013-11-29/522e6e86b100c.jpg&height=230&width=300" id="pictureHolder" alt="Foto: " style="vertical-align:middle
After this you have to get rid of the parts you don't want , something like this:
showicon.modify {substring(type=regex)|(\A.+)&height}
This results in a value of showicon of
imgs/epg/channel/2013-11-29/522e6e86b100c.jpg
After that (I think) you want to add the rest of the link, something  like
showicon.modify {addstart(not "")|www.whatever here.com/}
 
succes         Jan
 

WGMaker
Offline
WGMaker's picture
WG++ Team memberDonator
Joined: 12 years
Last seen: 9 hours
Is the support helpful?
support us

Daniel,
in xml the & is an illegal character and is replaced by the xml writer in WG++ by &amp; which is the standard . Any xml reader will automatically interpret it back to &.
So no worry, its as it should
 
Jan

WGMaker
Offline
WGMaker's picture
WG++ Team memberDonator
Joined: 12 years
Last seen: 9 hours
Is the support helpful?
support us

Daniel,
 
you say there are multiple img src ..  I can only try to answer your question if you tell me what distinguishes the one from the other and why you want this one and not another. (I guess it's not the style , margin or height that distinguishes them?)
Are you trying to get the channel logo for tv4-sverige ?
What siteini are you working on?
 
Jan
 
 

WGMaker
Offline
WGMaker's picture
WG++ Team memberDonator
Joined: 12 years
Last seen: 9 hours
Is the support helpful?
support us

Hi,
 
I have updated se.timefor.tv.ini to grab the channellogo. You can get it @ http://www.webgrabplus.com/sites/default/files/download/ini/info/SiteIni.Pack/Sweden/se.timefor.tv.ini
 
The trick here is to compose the block start to contain the channel id, which is present as site_id in the channel list in the config file. However you cannot get to this value directly, but have to use index_variable_element to copy the config_site_id into the process. With that you can add it to the scrubstring of index_channellogo scrubstring. This procedure is described in the manual section 4.5.3.
 
* get the channellogo:
*example :config_site_id="tv4-sverige"
index_variable_element.modify {addstart(scope=urlindex)|'config_site_id'}
index_urlchannellogo.scrub {single()|<a href="http://www.webgrabplus.com/tv-tabla/%27index_variable_element%27">|<img src="http://www.webgrabplus.com/%7C" alt=|</a>} * this is a big logo
* adding this line gets the small one:
*index_urlchannellogo.modify {remove|_big}

 
The resulting logo is rather big, you can get the smaller one if you enable the last line.
 
Jan

WGMaker
Offline
WGMaker's picture
WG++ Team memberDonator
Joined: 12 years
Last seen: 9 hours
Is the support helpful?
support us

It is better to leave productiondate in the dedicated xmltv element <date> especially if you ever start using the MDB postprocessor. For that it is an important value for selection and matching.
 
If you don't like the double you can remove it from the title.
 
Jan

Log in or register to post comments

Brought to you by Jan van Straaten

Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl