XWidgetSoft Forum
https://bbs.xwidget.com/

is.gd api
https://bbs.xwidget.com/viewtopic.php?f=8&t=3123
Page 1 of 1

Author:  Creator [ May 23rd, 2013, 3:52 am ]
Post subject:  is.gd api

is.gd api how to use the widget?
http://is.gd/
create.php?format=simple&url=www.example.com

Author:  Creator [ May 25th, 2013, 10:44 pm ]
Post subject:  Re: is.gd api

I found a way, he is quite fine with me, but terribly widget hangs.
how to make a thread?

Code:
function timercore1OnUpdate(Sender)
{
     function file_get_contents( url ) {   // Reads entire file into a string
   //
   // +   original by: Legaev Andrey
   // %      note 1: This function uses XmlHttpRequest and cannot retrieve resource from different domain.

   var req = null;
   try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {
      try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {
         try { req = new XMLHttpRequest(); } catch(e) {}
      }
   }
   if (req == null) throw new Error('XMLHttpRequest not supported');

   req.open("GET", url, false);
   req.send(null);

   return req.responseText;
}
var echo = file_get_contents('http://is.gd/create.php?format=simple&url=www.example.com');
alert(echo);
}

Author:  digigamer [ May 25th, 2013, 11:34 pm ]
Post subject:  Re: is.gd api

modify your code a bit!
Code:
req.open("GET",url,true);
req.onreadystatechange=function() {
  if (req.readyState==4) {
   var response = req.responseText; //do something

 }
 }
req.send(null);

This is better than GetHttpStrAsync

Note: the code above DOESN'T HAVE ANY RESTRICTIONS! Ignore the warning in your code. That's only for websites.

Author:  Creator [ May 26th, 2013, 12:01 am ]
Post subject:  Re: is.gd api

I can not ... can you please throw example

Author:  Creator [ May 27th, 2013, 3:45 pm ]
Post subject:  Re: is.gd api

up.............

Author:  digigamer [ May 28th, 2013, 7:18 pm ]
Post subject:  Re: is.gd api

I had given one, modify your code a bit
Code:

function timercore1OnUpdate(Sender)
{
     function file_get_contents_async( url ,callback) {   // Reads entire file into a string
   //
   // +   original by: Legaev Andrey
   var req = null;
   try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {
      try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {
         try { req = new XMLHttpRequest(); } catch(e) {}
      }
   }
   if (req == null) throw new Error('XMLHttpRequest not supported');

req.open("GET",url,true);
req.onreadystatechange=callback;
req.send(null);
}

file_get_contents_async('http://is.gd/create.php?format=simple&url=www.example.com',function() {
  if (req.readyState==4) {
   var response = req.responseText; //do something
   alert(response);
 });
}

Author:  Creator [ May 28th, 2013, 9:31 pm ]
Post subject:  Re: is.gd api

Knocks out a syntax error.

Attachments:
Untitled2.XWidgetPkg [6.65 KiB]
Downloaded 343 times

Author:  Creator [ May 28th, 2013, 10:17 pm ]
Post subject:  Re: is.gd api

[09:13:59 629]: [Script Error (line:23,char:3) ]

Nothing comes of not getting an answer ... alert function does not work

Author:  Creator [ May 28th, 2013, 10:18 pm ]
Post subject:  Re: is.gd api

Syntax Error ...

Author:  digigamer [ May 29th, 2013, 6:32 pm ]
Post subject:  Re: is.gd api

Oh! you could correct that, a simple bracket was missing...
Ok ok, I've streamlined the methods... you can now reuse with simple copy paste...

Grab the modified widget
Attachment:
Untitled2.XWidgetPkg [6.66 KiB]
Downloaded 338 times

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/