Page 1 of 1

Does put URL work correctly?

Posted: Tue Jan 05, 2016 5:09 am
by bbock
Hi,

This does not work for me, and I don't understand why. Hoping someone can help me.

put "https://.virustotal[DOT]com/en/domain/youtube[DOT]com/information/" into theURL
put URL theURL into theWebPageContent

(please note that the forum will not allow me to post the proper link, which has www directly after :// and . instead of [DOT] )

theWebPageContent variable ends up empty, even though if I copy/paste the above URL into a browser I can look at the page source using the browser and there is plenty of data.

Guessing I'm doing something wrong. I tried searching here and using Google but I have not been able to figure it out. Maybe someone here knows what the problem is? Thanks!

Re: Does put URL work correctly?

Posted: Tue Jan 05, 2016 5:37 am
by dunbarx
Hi.
put "https://.virustotal[DOT]com/en/domain/youtube[DOT]com/information/" into theURL
Did you mash two URL's together? If I massage your example a bit, I can get to two different web pages.

Craig Newman

Re: Does put URL work correctly?

Posted: Tue Jan 05, 2016 11:45 am
by Klaus
Hi bbock,

1. welcome to the forum! :D

2. What Craig said!

[url]https://.virustotal.com/en/domain/youtube.com/information/[/url]
Is a valid URL.
https://www.virustotal.com/en/domain/
Is and
https://www.virustotal.com/en/domain/
is, too!

And no luck with this one, too:
http://youtube.com/information/

So the answer to your question is, yes, it does work, if you provide a valid URL! :D


Best

Klaus

EDIT:
Corrected the links, they do work now and I put on sackcloth and ashes... :oops:

Re: Does put URL work correctly?

Posted: Tue Jan 05, 2016 3:20 pm
by bbock
Klaus,

Hmm. I suspect that if you post the original URL I provided into a browser (Firefox, Chrome, etc.) you will get results back from Virustotal.

So maybe it is not [technically] considered a valid URL? Not sure. So does that mean that the common web browsers all have this defect?

I also didn't notice that:
put the result into theError

produced any error for this. So if this is indeed an invalid URL then as far as I can tell Livecode is not producing an error indicating that.

Since Livecode is not producing an error, maybe there is another way to get this working?

Re: Does put URL work correctly?

Posted: Tue Jan 05, 2016 3:25 pm
by Klaus
Hi bbock,

well I made you initial link "clickable" and posted it, see first link in my posting!
All I get is "Safari cannot find the server..." (in german)
Same for the 2 other "virustotal" links, see above.

Maybe the site is down currently?


Best

Klaus

Re: Does put URL work correctly?

Posted: Tue Jan 05, 2016 3:26 pm
by bbock
Klaus,

p.s. I think you may have missed the "www" needs to be included as I mentioned ;-)

Re: Does put URL work correctly?

Posted: Tue Jan 05, 2016 3:38 pm
by SparkOut
I think you will find that put URL returns the static output from the server. If that is a redirect or includes JavaScript generated dynamic page results, then it won't give you the same output as a browser, but it isn't actually an error so the result will be empty.

Re: Does put URL work correctly?

Posted: Tue Jan 05, 2016 3:46 pm
by Klaus
bbock wrote:Klaus,
p.s. I think you may have missed the "www" needs to be included as I mentioned ;-)
Ouch, yes, sorry, my fault! :oops:

Will correct the links.

But it takes s while before that page loads now.
Maybe you can/need to adjust -> "the sockettimeoutinterval" so it works OK in Livecode?

Re: Does put URL work correctly?

Posted: Tue Jan 05, 2016 6:32 pm
by FourthWorld
Once I formatted the URL as specified I can indeed load it in the browser but in LC not only is the result empty but the return value is of zero length,

LibURL includes a command to use any field for logging, libURLSetLogField, which I use in this simple stack to try to diagnose mysteries with GET and PUT:
http://fourthworld.net/channels/lc/url_log.mc

The log from libURL says:

Code: Select all

_proxyForURL_proxyForURL end with none foundProxy for URL: 
socket selected: http://www.virustotal.com:443|6924
GET /en/domain/youtube.com/information HTTP/1.1
Host:www.virustotal.com
User-Agent: LiveCode (Linux)

HTTP/1.1 301 Moved Permanently
x-frame-options: DENY
x-xss-protection: 1; mode=block
Content-Type: text/html; charset=utf-8
Location: https://www.virustotal.com/en/domain/youtube.com/information/
Content-Language: en
Date: Tue, 05 Jan 2016 17:13:13 GMT
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Cache-Control: no-cache, must-revalidate
Server: Google Frontend
Content-Length: 0
Set-Cookie: VT_PREFERRED_LANGUAGE=en; expires=Tue, 12-Jan-2016 17:13:13 GMT; Max-Age=604800; Path=/
Alt-Svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"

_proxyForURL_proxyForURL end with none foundProxy for URL: 
socket selected: http://www.virustotal.com:443|6924
GET /en/domain/youtube.com/information/ HTTP/1.1
Host:www.virustotal.com
User-Agent: LiveCode (Linux)

HTTP/1.1 200 OK
Vary: Cookie
x-frame-options: DENY
x-xss-protection: 1; mode=block
Content-Type: text/html; charset=utf-8
Content-Language: en
Date: Tue, 05 Jan 2016 17:13:13 GMT
Server: Google Frontend
Content-Length: 0
Set-Cookie: VT_PREFERRED_LANGUAGE=en; expires=Tue, 12-Jan-2016 17:13:13 GMT; Max-Age=604800; Path=/
Alt-Svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
Expires: Tue, 05 Jan 2016 17:13:13 GMT
Cache-Control: private

_proxyForURL_proxyForURL end with none foundProxy for URL: 
socket selected: http://www.virustotal.com:443|6924
GET /en/domain/youtube.com/information/ HTTP/1.1
Host:www.virustotal.com
User-Agent: LiveCode (Linux)

HTTP/1.1 200 OK
Vary: Cookie
x-frame-options: DENY
x-xss-protection: 1; mode=block
Content-Type: text/html; charset=utf-8
Content-Language: en
Date: Tue, 05 Jan 2016 17:13:14 GMT
Server: Google Frontend
Content-Length: 0
Set-Cookie: VT_PREFERRED_LANGUAGE=en; expires=Tue, 12-Jan-2016 17:13:13 GMT; Max-Age=604800; Path=/
Alt-Svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
Expires: Tue, 05 Jan 2016 17:13:14 GMT
Cache-Control: private

CLOSED http://www.virustotal.com:443|6924
CLOSED http://www.virustotal.com:443|6924
So on the one hand we have a 301 for the original URL, but on the other hand it looks like libURL is responding appropriately to that by retrying at the redirect URL with a 200 (good) result.

What did I miss in reviewing that libURL log that would explain this issue?

And do any of you know the significance of the line: "_proxyForURL_proxyForURL end with none foundProxy for URL"?

Searching Google for "_proxyForURL_proxyForURL" turned up this discussion from the use-livecode list, but that deals with authentication and I don't see where that comes into play here:
http://runtime-revolution.278305.n4.nab ... 79094.html