Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Adam,.. I have no clue how to go about ths.. I tried to make something, didn't even try to run # it.. I know it won't work. I'm just trying to pull out one line of data from a webpage. From # weather.com.
- # I want people to type !heat "zipcode) .. like !heat 90210
- # And then it to search the site for that zipcode.. and scan the source for that like "Feels # like".. and output that "<span itemprop="feels-like-temperature-# fahrenheit">88</span>°</div>"
- # In this case the 88 would be what is needed to be seperated.
- # The webpage where you can type in a zipcode to search is # # # www.weather.com/common/welcomepage/worldhtml
- # Then once you search.. this is the output URL for my zipcode 35242
- # http://www.weather.com/weather/today/Birmingham+AL+35242?# # x=4&lswe=35242&lswa=WeatherLocalUndeclared&y=9
- #
- # But for example if I try to simplify the URL.. and type in www.weather.com/weather/today/35242 # it will output that same page. So seems like we could use the variable $2 to input the zipcode # after the url www.weather.com/weather/today/$2 (for their zipcode)
- # Then as above.. it has the "feels-like-temperature-fahrenheit"> code in there to pull the # number from.
- # I know this is simple.. I just can't do it.. :(
- # See if you can get this working.. I've got to figure out sock commands..
- on *:TEXT:!Heat*:#: {
- on *:sockopen:heatindex*: {
- if $sockerr > 0 { echo -a vlc not running | sockclose heatindex }
- sockwrite -n $sockname GET www.weather.com/weather/today/ HTTP/1.1
- sockwrite -n $sockname Connection: Keep-Alive
- sockwrite -n $sockname $crlf
- }
- on *:sockread:heatindex*: {
- if $sockerr > 0 P echo -a error | sockclose heatindex }
- sockread %hi
- if (*feels-like-temperature*) iswm %hi) {
- sockmark heatindex $nohtml (%hi)
- sockclose $sockname
- }
- }
- on *:sockread:heatindex*: {
- if $sockerr > 0 {echo -a error | sockclose heatindex }
- sockread %hi
- var $find $+(*fahrenheit">,$sock($sockname).mark,"*)
- msg $chan [Current Heat Index For $2 Is]: %hi
- unset %h*
- sockclose $sockname
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement