How to Launch a specific web page?

If you have a question or need help, this is the place to be.
Post Reply
MikeMc601f
Posts: 3
Joined: Fri Jan 09, 2009 4:39 pm

How to Launch a specific web page?

Post by MikeMc601f » Fri Jan 09, 2009 4:46 pm

Please help out a newbie. What i want to do is when i press a button on my remote it launches IE and goes to http://www.last.fm/listen/globaltags/hair%20metal
or if I press another button it would go to http://www.last.fm/listen/globaltags/funk
I have figured out how to launch IE but not how to tell it to go to a specific website. Thanks for the help.

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: How to Launch a specific web page?

Post by Pako » Fri Jan 09, 2009 7:23 pm

Here is one way. Copy & paste it into your config tree:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1487">
    <Folder Name="Open html pages" Expanded="True">
        <Macro Name="last.fm METALL" Expanded="True">
            <Action>
                EventGhost.PythonCommand(u'wx.LaunchDefaultBrowser("http://www.last.fm/listen/globaltags/hair%20metall")')
            </Action>
        </Macro>
        <Macro Name="last.fm FUNK" Expanded="True">
            <Action>
                EventGhost.PythonCommand(u'wx.LaunchDefaultBrowser("http://www.last.fm/listen/globaltags/funk")')
            </Action>
        </Macro>
    </Folder>
</EventGhost>
Pako

MikeMc601f
Posts: 3
Joined: Fri Jan 09, 2009 4:39 pm

Re: How to Launch a specific web page?

Post by MikeMc601f » Fri Jan 09, 2009 8:42 pm

Pako, Thanks so much for your reply,
i did as you said and put a simple keybord shorcut in for an event but i get this error:

2:37:21 PM Error in Action: "wx.LaunchDefaultBrowser("http://www.last.fm/listen/globaltags/hair%20metall")"

Any help would be greatly appreciated.

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: How to Launch a specific web page?

Post by Pako » Fri Jan 09, 2009 9:02 pm

What version of EventGhost you use?
Try the latest *_Setup.exe from here:
http://www.eventghost.org/downloads/
Pako

MikeMc601f
Posts: 3
Joined: Fri Jan 09, 2009 4:39 pm

Re: How to Launch a specific web page?

Post by MikeMc601f » Fri Jan 09, 2009 10:07 pm

That fixed it, Thanks Pako. A couple more questions if you don't mind:
How do I make it so when I go from "Funk" to "Hair Metal" it changes the current IE window instead of opening a new tab and having 2 songs playing at once? :?

On the website when a station is playing if you dont like a song you can click the |> button. Is there any way to control that?
THanks for all your help.

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: How to Launch a specific web page?

Post by Pako » Sat Jan 10, 2009 6:15 pm

MikeMc601f wrote:A couple more questions if you don't mind:
How do I make it so when I go from "Funk" to "Hair Metal" it changes the current IE window instead of opening a new tab and having 2 songs playing at once?
I am afraid that no simple way to resolve this, there is not. More could try this python script:

Code: Select all

from webbrowser import open as openurl
openurl("http://www.last.fm/listen/globaltags/funk", new = 0)
I do not have IE and I can not try. In Firefox, unfortunately, it does not work.
MikeMc601f wrote:On the website when a station is playing if you dont like a song you can click the |> button. Is there any way to control that?
Also this question holds the previous answer.
Pako

CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: How to Launch a specific web page?

Post by CollinR » Mon Jan 12, 2009 1:53 pm

wget will allow you to emulate clicking any hyperlink on a webpage.
Windows XP Pro sp3 - Several Machines usually latest beta but who knows.
Inputs: TCP / IR (USBUIRT) / RF(X10 Remote) / CLI-Batch / CCTV Motion / Ocelot
Outputs: TCP / IR (USBUIRT) / SageTV / SageTV Clients / YAC CallerID / HAL v3.7.3 / Ocelot

z3us
Posts: 42
Joined: Fri Jul 29, 2011 2:35 am

Re: How to Launch a specific web page?

Post by z3us » Sun Mar 04, 2018 4:02 pm

How can I launch a URL contained in {eg.event.payload[1]} ? The script doesn´t work with this variable

Edit: done, using the start program action with the path to chrome as executable and the variable in the Command line options field

User avatar
kgschlosser
Site Admin
Posts: 5402
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: How to Launch a specific web page?

Post by kgschlosser » Wed Mar 14, 2018 8:31 am

you can also use this script. This would be a better way because if you happen to change your default web browser you are going to have to update all of your EG macros.

But if you use this script it is going to use the default

Code: Select all

import webbrowser
webbrowser.open('http://www.microsoft.com')
If you like the work I have been doing then feel free to Image

Post Reply