Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

show ip per osd

If you have a question or need help, this is the place to be.
Post Reply
damdy-cash
Experienced User
Posts: 102
Joined: Tue Mar 28, 2006 6:48 am

show ip per osd

Post by damdy-cash »

Hi all,

I try to find a way to show with the EG OSD Plugin the outside IP of my PC.
What I have found is that pice of code:

Code: Select all

import httplib
def myIP():
    verb = HTTPConnection('www.whatismyip.com')
    verb.request('GET', '/automation/n09230945.asp')
    antw = verb.getresponse()
    html = antw.read()

    return html
Seems to do at least the starting part of that, but I can't find the way to show the received IP via the OSD- plugin.

Any proposal how that could work?

Many thanks in advance and cheers Volker
Gruß Damdy
User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: show ip per osd

Post by topix »

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1166">
    <Macro Name="Show my IP" Expanded="True">
        <Action>
            EventGhost.PythonScript(u"import httplib\nverb = httplib.HTTPConnection('www.whatismyip.com')\nverb.request('GET', '/automation/n09230945.asp')\nantw = verb.getresponse()\neg.globals.myIP = antw.read()\n")
        </Action>
        <Action>
            EventGhost.ShowOSD(u'My IP is: {eg.globals.myIP}\n', u'0;-24;0;0;0;700;0;0;0;1;0;0;2;32;Arial', (255, 255, 255), (0, 0, 0), 4, (0, 0), 0, 3.0, False)
        </Action>
    </Macro>
</EventGhost>
damdy-cash
Experienced User
Posts: 102
Joined: Tue Mar 28, 2006 6:48 am

Re: show ip per osd

Post by damdy-cash »

wow!! Many thanks, that was fast!! works perfect

And I see there was absolut no way for me to get it working :D

cheers Volker
Gruß Damdy
Post Reply