alias $ajax

By biase on Jul 16, 2011

For those who know what is ajax, will be automaticlly know what it does. I make it using $com with simple GET method to prevent from cracker/hacker misuse. For those who want to use in their script and want to releasing it, please keep my name for credit.

This snippet meant to get a html content from a webpage, but it will get an error when using it if it contain a big source of html web content.

Edit: Updated

;----------------------------------------------------------------------
; Author      :  bruas aka biase @ Webchat & DalNet
; URL         : http://www.biase.uni.cc/?mod=article&id=4
; Example     : var %content $ajax(http://www.biase.uni.cc)
;----------------------------------------------------------------------

alias ajax {
  if ((!$isid) || (!$1)) return
  var %a ajax | if ($com(%a)) .comclose %a
  .comopen %a msxml2.xmlhttp
  noop $com(%a,open,1,bstr,GET,bstr,$1,bool,true)
  noop $com(%a,send,1)
  noop $com(%a,ResponseText,2) | return $com(%a).result
  .comclose %a
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.