Author Topic: Random jokes  (Read 4089 times)

Amis

  • Newbie
  • *
  • Posts: 17
Random jokes
« on: May 18, 2008, 08:54:42 AM »
It's just a really basic script what export random jokes from www.randomjokes.com (One liners category).
Snerf: can you give me a hint on how I can add the HTTP script that you used in the new google? I can't make it work...

Command: !joke

http://amis.weasy.net/jokes.ice

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Random jokes
« Reply #1 on: May 18, 2008, 12:17:19 PM »
What cant you make work?  Need a bit more specifics then that. :mrgreen:
The IceChat God

Amis

  • Newbie
  • *
  • Posts: 17
Re: Random jokes
« Reply #2 on: May 19, 2008, 01:30:01 AM »
Old http script begin with this:
Code: [Select]
Set http = CreateObject("Microsoft.XmlHttp")
url = "some url"
http.open "GET", URL, FALSE
http.send ""
response = http.responsetext

The new:
Code: [Select]
Set http = CreateObject("Microsoft.XmlHttp")
url = "some url"
http.onreadystatechange = getRef("ProcessData")
http.open "GET", url, True
http.send
End Sub

Function ProcessData()
if http.readyState = 4 then
    if http.status = 200 then
etc...

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Random jokes
« Reply #3 on: May 19, 2008, 11:34:50 AM »
Did you "Dim http" on the top of the script, like I did, as it now needs to be a global object, since your using it in multiple subs/functions.
The IceChat God