Wondering if anyone out there is having problems with this script today?
Announcement
Collapse
No announcement yet.
custom_cnn_headlines
Collapse
X
-
custom_cnn_headlines
- Pete
Auto matorHomeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home AssistantTags: None
-
- Pete
Auto matorHomeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant
Comment
-
anogee
Fixed it for now with the line:
body = hs.StringItem(body,1,"<")
Basically this just strips out the text after the first "<" which is the part you don't want. Place this line just before where it sets the device in the script.
But CNN is revamping their web pages so we may want to wait before making more permanent changes.
Comment
-
Rupp, yes its an advertisement for a CNN video. Its coming up at the end of the news alert (custom_cnn.txt
) not the beginning of the headlines (custom_cnn_headlines.txt) as I thought previously. Where does the line go? Thanks Anogee.- Pete
Auto matorHomeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant
Comment
-
Anogee, what are the before and after lines for your recommended patch? OR should we wait until CNN finished their "upgrades"?- Pete
Auto matorHomeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant
Comment
-
anogee
I'm hesitant to give an exact location because I know there are a few versions of the script out there but if your running ver 2.5 (I think is the latest)
Look for this section of code:
body = Mid(body,x, len(body) - x)
iStart = Instr(1,body,"<div id=""cnnNarrowBulletinText"">")
iEnd = Instr(1,body,"<a href")
if iEnd = 0 then
iEnd = Instr(1,body,"</div>")
end if
if iStart + 32 > len(body) OR iEnd - (iStart+33) > len(body) OR iEnd - (iStart+33) < iStart + 32 then
exit sub
end if
body = Mid(body,iStart + 32, (iEnd - (iStart+33)))
Then after this place this additional line:
body = hs.StringItem(body,1,"<")
The StringItem command is not the most elegant way to do this, but it is the easiest. Basically this command parses a line and extracts items based on a delimiter, in this case "<". Since we want the text BEFORE the inserted ads, a 1 says first item. Not a whole lot of thought here, because I know CNN will be changing it soon, but this seems to work for now.
Comment
-
Thank you anogee - works great. Guess I am pretty used to seeing it and miss it a lot when its gone.- Pete
Auto matorHomeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant
Comment
Comment