Does put URL work correctly?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
bbock
Posts: 4
Joined: Mon Jan 04, 2016 1:00 pm

Does put URL work correctly?

Post by bbock » Tue Jan 05, 2016 5:09 am

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!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Does put URL work correctly?

Post by dunbarx » Tue Jan 05, 2016 5:37 am

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

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Does put URL work correctly?

Post by Klaus » Tue Jan 05, 2016 11:45 am

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:

bbock
Posts: 4
Joined: Mon Jan 04, 2016 1:00 pm

Re: Does put URL work correctly?

Post by bbock » Tue Jan 05, 2016 3:20 pm

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?

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Does put URL work correctly?

Post by Klaus » Tue Jan 05, 2016 3:25 pm

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

bbock
Posts: 4
Joined: Mon Jan 04, 2016 1:00 pm

Re: Does put URL work correctly?

Post by bbock » Tue Jan 05, 2016 3:26 pm

Klaus,

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

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: Does put URL work correctly?

Post by SparkOut » Tue Jan 05, 2016 3:38 pm

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.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Does put URL work correctly?

Post by Klaus » Tue Jan 05, 2016 3:46 pm

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?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Does put URL work correctly?

Post by FourthWorld » Tue Jan 05, 2016 6:32 pm

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
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply