NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums General General Discussion v
« Previous 1 … 18 19 20 21 22 … 159 Next »
Running a javascript command from Windows Address Bar FOLLOWING the Web address?

 
  • 0 Vote(s) - 0 Average
Running a javascript command from Windows Address Bar FOLLOWING the Web address?
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#21
2011-02-24, 12:42 PM
should be able to, if you can find the javascript cmd to use and it works in address bar...
of course it won't adapt to page structure changes, so the more reliable the pages, the more reliable the script..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
Reddwarf
Offline

Posting Freak

Posts: 6,629
Threads: 230
Joined: Mar 2007
#22
2011-02-24, 05:15 PM
It'd need some work yes, to give you an idea here's the page I had in mind http://www.vg.no/tv-guide/#d=2011-02-24

"I'd rather have a bottle in front of me than a frontal lobotomy"
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#23
2011-02-24, 05:45 PM
you can get to those by using a regular address..http://www.vg.no/tv-guide/#d=2011-03-01 thursday http://www.vg.no/tv-guide/#d=2011-03-02 -friday, etc...
his page HAS to use javascript to show the other pages, and they didn't build in any cmd line interface like your site has..
so whatever grabber you use just point it to relevant date-pages.."http://www.vg.no/tv-guide/#d={desired date}"
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
Reddwarf
Offline

Posting Freak

Posts: 6,629
Threads: 230
Joined: Mar 2007
#24
2011-02-24, 05:51 PM
pBS Wrote:you can get to those by using a regular address..http://www.vg.no/tv-guide/#d=2011-03-01 thursday http://www.vg.no/tv-guide/#d=2011-03-02 -friday, etc...
his page HAS to use javascript to show the other pages, and they didn't build in any cmd line interface like your site has..
so whatever grabber you use just point it to relevant date-pages.."http://www.vg.no/tv-guide/#d={desired date}"

Mmmm, I see (I think). Haven't found a grabber that copes with this page, any tips of a grabber that could work out-of-the-box?

"I'd rather have a bottle in front of me than a frontal lobotomy"
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#25
2011-02-24, 10:49 PM
if it grabs the first page ok, then grabber works... save each days page to hard drive and tell the grabber to find each page you saved locally [file://] instead of on http://
or try appending them all into one and see what happens..
it'll always have to be custom to deal with that site as i doubt any others are same..
so i'd search for it..someone somewhere probably has made a script to deal with it..
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
jksmurf
Offline

Posting Freak

HK (DMBTH)
Posts: 3,590
Threads: 410
Joined: Jul 2005
#26
2011-03-01, 11:24 AM
Hi Guys

Sorry, been away at my brothers' wedding. Will tackle these later this week.
@Reddwarf. TVxB works great as a grabber. Very configurable parser.

Kristian
ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | AC86U/AC68U | USB-UIRT | RPi4 Libreelec | Sony Bravia LCD X9000F Android TV |
jksmurf
Offline

Posting Freak

HK (DMBTH)
Posts: 3,590
Threads: 410
Joined: Jul 2005
#27
2011-03-07, 01:13 AM
Hi pBS ...

Right, I've incorporated the code from your posts #14 and #18, and #19.

Generally the script seems to run OK with post #18, and produces the html's in the format that TVxB needs (I slightly modified your code to do this) but ...

1. Between (and sometimes within) the last date of the first weeks schedule and the first date of the second week, I get a duplicate of the saved page, with cosnecutive dates, like it's not fast enough to complete the javascript command on the page before the script asks it to save. I haven't tried increasing sleep (yet), but it seems to me there should be either inherent in the _IE scripts, OR using a routine I found (See BrowserWaitUntilDone()), that it must surely be able to wait until that "Done" appears.

The subroutine runs OK from the debug, but still doesn't always seem to wait.

I thought it might be that it needed to "see" the IE Window to "see" the "Done" Text, hence you will see me revert to the "visible" code, but no joy there either.

Code:
; With these two lines you can see it working **
$oIE = _IECreate()
_IENavigate($oIE,"http://www.setanta.com/HongKong/TV-Listings/"); _IE that navigates to the first page and waits until "done". ; Opens Setanta Website ...
;
; ** Alternatively with just these two lines it will work silently without opening IE Window from pBS
;$oIE = _IECreate("http://www.setanta.com/HongKong/TV-Listings/",0,0); Open WebPage (Was just $oIE = _IECreate())
;_IELoadWait($oIE); _IE  loads page and waits until REALLY "DONE" to avoid "The Requested Resource Is in Use" Error Messages ...

2. For the date routine from post #19, I added this as a subroutine, and again it seems to get called OK, but the messagebox is not invoked. I'm not 100% sure why exactly yet, there is text in the source which says class="selected", I still need to get my head around the StringRight( StringTrimRight ($line, 13), 3) code to see if that is correct though.

Code:
<li id="ctl00_cphForm_AllCols_tvlHeader_rptDays_ctl01_listItem" class="selected"><a onclick="Cognifide.Utils.TrackWithEvent('Mon, 07 Mar', 'Tab-Date');" id="ctl00_cphForm_AllCols_tvlHeader_rptDays_ctl01_btnDay" href="javascript:__doPostBack('ctl00 $cphForm$AllCols$tvlHeader$rptDays$ctl01$btnDay','')">Mon, 07 Mar</a></li>

3. Note that I disabled the timezone code because the Setanata site says all times HK. I'm not convinced yet though, although if I can harvest the date using post #19, then this should no longer be required.

Code:
$savedate = StringLeft(_DateAdd( 'h',6, _NowCalc()),10)

If you have any suggestions for the above, I'd be glad to have a moment of your time. I've done a lot of runs to see/learn what code does, I have done a little bit of "coding" using VB Macros in Excel, but this is like learning a whole new set of instructions, and the Syntax takes a while to grasp.

Cheers

k.

@Redwarf - I looked at your http://www.vg.no/tv-guide/ and thought at first, "ah this could be done easily using TVxB's simple release sequence"

url=http://www.vg.no/tv-guide/#[day=yyyy-mm-dd]

a bit like the one from http://www.tvxb.com/country/Norway/TVxb-...genstv.ini.

BUT now I see the problem, it's not like my site, where even if you ran that TVxB sequence and TVxB saved the pages, no page actually HAS any EPG data, ONLY channel data. The bad news seems to be that EVEN if you used Autoit and ran the javascript, when you view the source (which for me shows I CAN harvest the EPG data) EVEN if you ran the javascript, then there is no button click which seems to present a page where the data is then displayed as the source. It's wierd, I wonder how it gets shown at all. Clearly I am no expert!

Cheers

k.
ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | AC86U/AC68U | USB-UIRT | RPi4 Libreelec | Sony Bravia LCD X9000F Android TV |
Reddwarf
Offline

Posting Freak

Posts: 6,629
Threads: 230
Joined: Mar 2007
#28
2011-03-07, 04:29 AM
So it's no joy then... Sad

"I'd rather have a bottle in front of me than a frontal lobotomy"
jksmurf
Offline

Posting Freak

HK (DMBTH)
Posts: 3,590
Threads: 410
Joined: Jul 2005
#29
2011-03-09, 05:51 AM (This post was last modified: 2011-03-09, 06:06 AM by jksmurf.)
Reddwarf Wrote:So it's no joy then... Sad

Not necessarily.... I've been working steadily but slowly on this and discovered this:

http://javascript.about.com/library/blsource.htm

When I run the js on the page it SHOWS the CORRECT html source. Try it manually. Simply

1. Visit http://www.vg.no/tv-guide/#2011-03-11

then

2. Copy and paste the entire line from javascript to close();})(); into your browser address bar.
Code:
javascript:(function(){c=unescape(document.documentElement.innerHTML);c=c.replace(/&/g,'&');c=c.replace(/</g,'<');c=c.replace(/>/g,'>');c=c.replace(/</g,'&lt;');c=c.replace(/>/g,'&gt;');document.write('<html><head><title>Source of Page<\/title><\/head><body><pre>'+c+'<\/pre><\/body><\/html>');x.document.close();})();


What you will see is EXACTLY what you want, a way to harvest the EPG for each channel.

You could thus do a crude implementation by using my script, modify it to visit each page in turn, then paste that mess above into the address bar for each page to get the actual EPG you want TVxB to parse.

k.

btw apparently autoit's _IEDocReadHTML "should" do this, so maybe you will have more luck than me. It only half works for me. See my wailing here

http://www.autoitscript.com/forum/topic/...ntry876908

k.
ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | AC86U/AC68U | USB-UIRT | RPi4 Libreelec | Sony Bravia LCD X9000F Android TV |
Reddwarf
Offline

Posting Freak

Posts: 6,629
Threads: 230
Joined: Mar 2007
#30
2011-03-09, 06:03 AM
Magic! The script in post 27?

"I'd rather have a bottle in front of me than a frontal lobotomy"
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (4): « Previous 1 2 3 4 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple PIP windows in Firefox Graham 0 1,756 2020-09-25, 11:45 AM
Last Post: Graham
  Why Do People Upgrade to Windows 10? ga_mueller 12 8,225 2019-08-11, 01:21 PM
Last Post: Ludron
  Windows 10 Ramdrive for buffer PaulW 1 1,765 2018-10-16, 10:45 PM
Last Post: gEd
  Downgrade Windows Reddwarf 9 4,500 2017-05-26, 07:12 PM
Last Post: tonyjohn29
  Windows 10 Preview removes command prompt p37307 13 5,730 2016-12-10, 03:49 AM
Last Post: johnsonx42
  Windows 10 Update September 29, 2016 — KB3194496 p37307 0 2,659 2016-09-30, 09:32 AM
Last Post: p37307
  Windows 10 Anniversary NPVR fullscreen flicker and freeze fix p37307 1 3,217 2016-08-11, 02:59 AM
Last Post: sub
  windows 10 jrhcom 3 3,334 2015-10-07, 10:43 PM
Last Post: jrhcom
  Windows 10 DVD Player app craigrs84 10 6,778 2015-09-10, 11:06 PM
Last Post: sub
  NPVR getting some props now that Windows Media Center is going away pcostanza 6 4,121 2015-08-24, 10:20 PM
Last Post: johnsonx42

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode