Skip to content

Supybot Website

Sections
Personal tools
You are here: Home » Supybot Discussion Forums » User Forum » Weather again..

 • Weather again..

Document Actions
Replies: 6   Views: 1953
Up one level
You need to be a registered member to post to this forum. Register now.

 • Weather again..

Posted by xcamel at 21:57 February 12, 2008
Any recent updates to the weather plugin to get cnn and ham working again?
Member
Posts: 21

 • Re: Weather again..

Posted by xcamel at 13:22 March 10, 2008
Update - now wunder rss has stopped working...
Member
Posts: 21

 • Re: Weather again..

Posted by mgoldey at 19:04 March 14, 2008
I tried the change you posted on the developer's forum ( http://supybot.com/forums/developers/137398827764 ) w/o success. I assume that line was a modification of the existing line at 466, and not an entirely new line of code?
Member
Posts: 23

 • Re: Weather again..

Posted by xcamel at 21:01 March 14, 2008
Sorry.. line 471/472

_rsswunderfeed = re.compile(r'<link rel="alternate".*href="([^"]+)" */?>',
re.I)
Member
Posts: 21

 • Re: Weather again..

Posted by mgoldey at 09:56 March 15, 2008
In my plugin, line 471 is part of a comment.

Here's what I've got:

code:
        wunder = wrap(wunder,['text'])

        _rsswunderUrl = 'http://www.wunderground.com/cgi-bin/findweather/' \
                        'getForecast?query=%s'
        _rsswunderfeed = re.compile(r'<link rel="alternate".*href="([^"]+)">',
                                    re.I)
        _rsswunderSevere = re.compile(r'font color="?#ff0000"?><b>([^<]+)<',
                                      re.I)
        def rss(self, irc, msg, args, loc):
            """<US zip code | US/Canada city, state | Foreign city, country>

            Returns the approximate weather conditions for a given city.
            """
            url = self._rsswunderUrl % utils.web.urlquote(loc)
            url = url.replace('%20', '+')
            text = utils.web.getUrl(url, headers=Weather.headers)
            if 'Search not found' in text or \
               re.search(r'size="2"> Place </font>', text, re.I):
                Weather._noLocation()



I think what you're suggesting is to replace:

code:
_rsswunderfeed = re.compile(r'<link rel="alternate".*href="([^"]+)">',
                                    re.I)


With
code:
_rsswunderfeed = re.compile(r'<link rel="alternate".*href="([^"]+)" */?>',
re.I)
which adds
code:
*/?
near the end of the line?

Or is it something else?

Thanks.
Member
Posts: 23

 • Re: Weather again..

Posted by xcamel at 20:31 March 24, 2008
You nailed it..
I was using the Weather plugin from the _darcs repository, which is a slightly newer version.
Member
Posts: 21

 • Re: Weather again..

Posted by mgoldey at 14:28 March 26, 2008
Thanks. No love for me with that edit, though.

<mgoldey> !weather 84532
<goldeybot> mgoldey: Error: HTTP Error 500: Server Error

Where is the _darcs repository? A newer version is worth a shot . . . .

TIA.
Member
Posts: 23

 

Powered by Plone

This site conforms to the following standards: