How do I parse a web page via a URL in the clipboard

Hi.
I would like to read the html source of a web page into a string variable. The contents of the clipboard contains the URL.
How do I do this ?
Regards,
Harry W.
PowerMac G5 Dual 2.5GHz   Mac OS X (10.4.3)  

What I have done is write an Applescript that parses a URL copied from a web site (http://www.ebroadcast.com.au/TV/static/PerthNight.html?) read the web page using CURL and use the EyeTV API to schedule a recording.
The applescript is as follows;
property |version| : 1.0
property author : "HarPat Software"
property |date| : date "Saturday, 18 February 2006 12:00:00 AM"
property license : "freeware, open-source"
version 1.0, February, 18, 2006
- Initial version.
set theURL to contents of (get the clipboard) as text
if theURL contains "http://www.ebroadcast.com.au/cgi-bin/TV/detail?" then
set thePage to do shell script "curl " & quoted form of theURL
set theBDateStr to "Broadcast Date: "
set theChannelStr to "&chan="
set theDescriptionStr to "&descrip="
set theBTimeStr to the offset of "Broadcast Time: " in thePage
set theDurationStr to the offset of "Timeslot Duration: " in thePage
set theBDateOff to the offset of theBDateStr in thePage
copy (characters (theBDateOff + (length of theBDateStr)) thru ((the offset of "Channel: " in thePage) - 9) of thePage) as string to theBroadcastDate
set theChannelOff to the offset of theChannelStr in theURL
copy (characters (theChannelOff + 6) thru ((the offset of "&state=" in theURL) - 1) of theURL) as string to theChannel
set theDescriptOff to the offset of theDescriptionStr in theURL
copy (characters (theDescriptOff + 9) thru ((the offset of "&fta=" in theURL) - 1) of theURL) as string to theTitle
set theBTimeOff to the offset of theBTimeStr in thePage
copy (characters (theBTimeOff + (length of theBTimeStr) + 23) thru ((the offset of "Classifications: " in thePage) - 10) of thePage) as string to theBroadcastTime
set theDurationOff to the offset of theDurationStr in thePage
copy (characters (theDurationOff + (length of theDurationStr) + 26) thru ((the offset of "<!--<br>" in thePage) - 11) of thePage) as string to theDuration
set Durationsecs to (theDuration as integer) * 60
set thetheBroadcastDateTime to theBroadcastDate & " " & theBroadcastTime
set aChannel to 0
if theChannel = "2" then
set aChannel to 1
end if
if theChannel = "7" then
set aChannel to 2
end if
if theChannel = "9" then
set aChannel to 3
end if
if theChannel = "10" then
set aChannel to 4
end if
if theChannel = "SBS" then
set aChannel to 5
end if
if theChannel = "31" then
set aChannel to 6
end if
tell application "EyeTV"
make new program with properties {start time:date thetheBroadcastDateTime, duration:Durationsecs, title:theTitle, channel number:aChannel}
end tell
end if
I'm not very good at scripting yet so please don't laugh at my code.
Regards,
Harry Werkman

Similar Messages

  • How can I forward a web page (not a link but the page) using Mac Mail'Mountain Lion?

    I want to mail a web page, not a link to the page but the page itself. I use Mountain Lion and Mac Mail. I used to be able to do this with Lion.

    Look in the outgoing email message window. Make sure Send Web Content is not set to Link Only

  • Dreamweaver CC suddenly (yesterday) stopped viewing web pages via F12 key.  the browser opens but times out on all browsers now

    I have been running Dreamweaver since 2008 (CS).  I have a server on the local network that I save my work on and remotely connect to it via a mapped network drive W while in Dreamweaver.  When Dreamweaver starts it loads via the site the mapped drive contents.  It shows the files and folders of clients I am currently working on.  Up until yesterday I was able to open a folder in Dreamweaver CC, work on a file and to view it in a browser, I would of course save the current changes and press the F12 key to bring up the browser and display the web page in full screen view.  I never used the live view button on the Dreamweaver menu before, I only pressed the F12 key to see the browser in full screen and display the html page.
    However since yesterday when I press the F12 key any of my browsers (Firefox 29.01, Internet Explorer 11, Opera (latest), Safari (latest)  and Chrome (latest) only open and Time Out.
    I am running Windows 8.1 update
    I am running Adobe Cloud CC for my Adobe Products
    Attempted Fixes to date:
    I have searched online forums
    I have uninstalled Dreamweaver CC and re installed it
    I again uninstalled and reinstalled Dreamweaver CC and deleted the profile settings
    I have contacted Adobe support but they said the F12 key worked so cannot help any more
    I still have the same problem.
    The only way to view these files in a browser is to right click the file and select open with and select the browser to check it with.
    Can anybody help me as I have been running my current set up since 2008 without any issues.

    Can you verify that the shortcut key is assigned properly for browser preview here:
    If it isn't, Click the last option 'Edit Browser List' > edit the settings in the preferences tab:
    This will ensure that your keyboard shortcut is mapped properly.
    If the setting in 1st screenshot shows the shortcut properly, but still isn't loading, you could try trashing your cache: Deleting a corrupted cache file
    Let us know how it goes.

  • How do you download a web page to a folder on the desktop without having all of the other rubish with it

    When looking on Web Sites associated with Ancestry information how can i save the information i find to a folder on my desktop without having 3/4 files with other information that i do not want / need. The information i want is shown in a second file which is great but when i delete the 3/4 files i do not want it removes the file that i do want also. I use Windows 7.

    Hi bjmw,
    What is the method you are using to download the webpage? Are your right clicking on the webpage and choosing "Save as.." or using an alternative method? The 3 or 4 files you are getting are likely the style-sheets associated with the website, without them the website would be nearly impossible to read.
    Thanks,
    Scott

  • How do I make a web page that changes every time the user refreshes it? Is it possible in Muse?

    Hi, i'd like to make quite a simple website where the main text in the centre of the page changes every time the user refreshes the page in their browser. I assume i'll have to make one master, and multiple pages that are all the same except for the changes in the text, but i'm not sure how to make it so that every refresh directs to a different page and not just the home page? Is this even possible in Muse?
    This is an example of what i'm going for: :: procatinator ::
    Thanks!

    You can't do it with Muse alone. Would probably be fairly simple to do with a bit of Javascript. Check the widget directory as it is possible someone has made a widget for random content. If not, maybe I will make one this weekend. ;-)

  • How do i open a web page with VeriSign Class 3 Extended Validation SSL SGC SS CA certfificate i can't open web pages with this, how do i open a web page with VeriSign Class 3 Extended Validation SSL SGC CA certfificate i can't open web pages with this

    how do i open a web page with VeriSign Class 3 Extended Validation SSL SGC SS CA ?

    Hi
    I am not suprised no one answered your questions, there are simply to many of them. Can I suggest you read the faq on 'how to get help quickly at - http://forums.adobe.com/thread/470404.
    Especially the section Don't which says -
    DON'T
    Don't post a series of questions in  a single post. Splitting them into separate threads increases your  chances of a quick answer.
    PZ
    www.pziecina.com

  • How do I enlarge my web page to use the whole screen?

    How do I enlarge my web page to use the whole computer screen?

    Reduce dock size or hide same.
    Also depends on what browser you're using  all have full screen modes.
    Safari :
    http://support.apple.com/kb/PH11941
    To enlarge an entire webpage so it uses the screen, click the arrows in the top-right corner of an app window:

  • How do you build a web page to display queued messages ?

    How do you build a web page to display queued messages in all states?
    Thanks,
    Reeta
    Reeta Joseph Benoy
    EDS@XEROX
    Database Administration
    1350 Jefferson Rd
    Rochester, NY 14623

    You can build a form to a procedure in oracle portal that explores the queue with the option browse and prints de type message with htp package. I made it in this way and my applicattion works right. The procedure must loop the select count(msgid) from aq$[queuetable_name] times.

  • How do you insert live web pages in keynote?

    How do you insert live web pages in keynote?

    Insert a 2D Pie chart on the slide (Insert > Chart > 2D Pie), then place a circle from Shapes overlaid in the centre:

  • How do you put safari web pages into icloud with the safari iCloud button?

    how do you put safari web pages into icloud with the safari iCloud button?

    What that button does is sync your tabs between your devices. So if you have multiple macs with Mountain Lion and/or devices with iOS 6 (once it comes out this fall) you can pick up where you left off. For example, let's say I have apple.com, nytimes.com, and facebook.com open on my mac, but I need to run. Later, if I need to use another computer in my household, I can just restore the tabs that I was using before on this other mac.

  • How do you send a web page in safari

    How do you send a web page in safari

    File > Mail Contents of This Page
    File > Mail Link to This Page

  • How do you HYPERLINK a web page address to an EXCEL document in Firefox like is possible in Explorer

    How do you HYPERLINK a web page address to an EXCEL document in Firefox like is possible in Explorer?

    When you follow a hyperlink in Excel, usually it should open in your default browser. You shouldn't have to do anything special in Excel to create the link when Firefox is your default browser compared with IE. However, the Insert Hyperlink dialog might work differently. I think it might be able to automatically pre-populate a URL from IE, while in Firefox, you need to copy the URL from Firefox's address bar and paste it into the Insert Link dialog.

  • How can I print a web page to a hard copy with Adobe?

    How can I print a web page to a hard copy with Adobe? When I print this particular page in the usual way it prints only the text of that page, not the photo that's also part of that page.

    I have Adobe SendNow, but I can buy another Adobe product if it will solve my web page printing problem.

  • How do I get my web pages back to original size? My fonts are all too large and keep reverting after I change them back!

    How do I get my web pages back to original size? My fonts are all too large and keep reverting after I change them back!

    That has not worked. I do it and still it reverts. Isn't there a way to tell Firefox to just go back to default settings?

  • How to embed mp4 in web page so it will play in Adobe Flash Player?

    I have an mp4 that is wrapped (or published) by an swf. I have successfully embedded the swf in a web page but when I play the video from the web page the quaility is significantly degraded. Unfortunately I have no control over the internals of the swf so what I would prefer to do is to embed the mp4 rather than the swf. I understand Adobe Flash Player supports mp4 since version 9, but I haven't been able to figure out the html to make this happen. Here is the code I am currently using with the swf. Can anyone suggest how to modify this for embedding the mp4?
    <html>
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
    codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
    http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab
    width="720" height="400" id="test" align="middle">
    <param name="movie" value="T1S_Opening_Slideshow.swf" />
    <param name="quality" value="high" />
    <param name="play" value="true" />
    <param name="bgColor" value="#FFFFFF" />
    <param name="wmode" value="transparent" />
    <embed src="T1S_Opening_Slideshow.swf"
    width="720" height="400"
    quality="high"
    play="true"
    bgColor="#FFFFFF"
    wmode="transparent"
    type="application/x-shockwave-flash"
    pluginspage="http://www.macromedia.com/go/getflashplayer"http://www.macromedia.com/go/getflashplayer />
    </object>
    </html>

    I didn't mean to imply the HTML code affects quality (although the qualtiy tag technically does that) . The internal settings in the swf are affecting quality. If I play the mp4 directly the quality is fine. If I play it through the swf wrapper the quality is degraded. I want to take the swf wrapper out of the picture.

Maybe you are looking for