Page 1 of 1

Put url or Get Url Don't Work fine in Android!!!

Posted: Thu Jan 17, 2013 5:21 pm
by Fasasoftware
Dear friend,

i think to have founded a big bug on android dev.....the put url or get url command don't return the same text like in pc or mac on the same url!!

For me is a big bug....i need to work with the text...also in android....

Below there's the bug number......

I hope livecode team will fix soon..

i have also attached a stack demo example...

best regards...

Lestroso :shock:

Bug 10647 - Put Url or Get Url Don't work Properly Fine In Android

Re: Put url or Get Url Don't Work fine in Android!!!

Posted: Thu Jan 17, 2013 7:44 pm
by jacque
Your scripts have some non-standard characters before each line (maybe you pasted them from the forum?) If you remove those characters, does it work in Android? I see ascii 194 and 160 before almost every line of script. The Android parser may not be able to work with those characters.

You can tell there is something wrong because typing the tab key in the script editor does not reformat the lines correctly. You can see the wrong characters if you paste the script into a text editor that shows invisible characters.

I use get/put url in Android without any trouble.

Re: Put url or Get Url Don't Work fine in Android!!!

Posted: Thu Jan 17, 2013 10:16 pm
by Fasasoftware
Dear Jaquelin,

if you say not a bug.....can you modify my little stack to working.and attach here..??? I'm sorry but perhaps i'm not be able to program the right script....can you help me ?please??

best regards,

Lestroso :oops: :oops:

Re: Put url or Get Url Don't Work fine in Android!!!

Posted: Thu Jan 17, 2013 10:44 pm
by Simon
Hi Lestroso ,
investing.com have a mobile site!! :lol: :lol:
You are downloading 2 different sets of content.
If you look at the bottom fld in the Android sim while running your app you will see <meta name "HandheldFriendly"..

Actually, probably a much better site for you to parse info from.

Simon

Re: Put url or Get Url Don't Work fine in Android!!!

Posted: Thu Jan 17, 2013 11:32 pm
by jacque
Lestroso, you can fix the scripts easily. Delete all the white space before each line. Right now your handler looks like this:

Code: Select all

on mouseUp
   put"" into FLD "TESTO"
   put URL "http://www.investing.com/technical/technical-summary"  into fld 1
  
   
  put wordoffset("EUR/USD", fld 1 ) into tOffW
     put wordoffset(">SUMMARY:<", fld 1 ) into tOffW
    ## Calculate the num of characters from word 1 to the found word:
  put the num of chars of word 1 to tOffW of fld 1 into tCharOffset
    ## tCharOffSet is the number of the last character of the found word with WORDOFFSET
  ## Add 2 to start with the FIRST character of the next WORD
  add 2 to tCharOffSet
  ## or do NOT add 2 to also select the SPACE after the found word!
    ## Now you can start from this value to selecte any  number of characters AFTER the found word:
  select char tCharOffSet to tCharOffSet + 700 of fld 1
PUT THE SELECTEDTEXT  INTO FLD "TESTO"
end mouseUp
Change it to look like this, against the edge of the editor:

Code: Select all

on mouseUp
put"" into FLD "TESTO"
put URL "http://www.investing.com/technical/technical-summary"  into fld 1

put wordoffset("EUR/USD", fld 1 ) into tOffW
put wordoffset(">SUMMARY:<", fld 1 ) into tOffW
## Calculate the num of characters from word 1 to the found word:
put the num of chars of word 1 to tOffW of fld 1 into tCharOffset
## tCharOffSet is the number of the last character of the found word with WORDOFFSET
## Add 2 to start with the FIRST character of the next WORD
add 2 to tCharOffSet
## or do NOT add 2 to also select the SPACE after the found word!
## Now you can start from this value to selecte any  number of characters AFTER the found word:
select char tCharOffSet to tCharOffSet + 700 of fld 1
PUT THE SELECTEDTEXT  INTO FLD "TESTO"
end mouseUp
Then hit the Tab key on the keyboard. The script should reformat and align correctly. See if that fixes the Android problem.

Re: Put url or Get Url Don't Work fine in Android!!!

Posted: Thu Jan 17, 2013 11:55 pm
by Simon
Hi Jacqueline,
While he should see that the script editor will format his scripts automatically (good thing) the problem is while using the Android sim he connects to a different site than when using Mac or PC.
The word ">SUMMARY:<" is not in the mobile site but it is in the desktop version.

Ahh, I see... "put URL" should not send the User Agent so how does investing.com know?? :(
WOW.

Simon

Re: Put url or Get Url Don't Work fine in Android!!!

Posted: Fri Jan 18, 2013 2:01 am
by Simon
OK, so I've built a test stack that shows "put URL" follows redirects in Android, possibly because the user agent is sent.
Button Touch

Code: Select all

on mouseUp
   put ""  into fld "Touch"
   put url "http://touch.investing.com" into fld "Touch"
end mouseUp
Button Invest

Code: Select all

on mouseUp
   put "" into fld "Invest"
   put url "http://investing.com" into fld "Invest"
end mouseUp
Then the Compare button which checks if the two fld are the same. (You will note I needed to delete a line from each fld because the prices change every second).

On desktop the flds are very different, in Android the flds are the same.

Simon

Re: Put url or Get Url Don't Work fine in Android!!!

Posted: Fri Jan 18, 2013 1:23 pm
by Fasasoftware
Well i thank you to all....but Simon as you say in the mac and pc put url return the same text...in android not....why???

I need to fix it...because my app is based on that command...and so i can't operate in android if so....

Can you help me???


best regards,

Lestroso :oops:

Re: Put url or Get Url Don't Work fine in Android!!!

Posted: Fri Jan 18, 2013 6:37 pm
by Fasasoftware
Dear LIVECODE TEAM,

Your the best!!!!!

Dear friend...I'm sorry....

Now i have Understood your solution!!!!! And it works fine!!!!!

I have made a mistake of understanding!!!!

i have used this "set the httpHeaders to "User-Agent: MyApp""...but nothing happend....because i have not changed the name of "Myapp"...

but now the right solution for me is:

ibop is the name of my app...
----------------------------------------------
set the httpHeaders to "User-Agent: ibop" <---this works very fine!!!!!

PUT URL "http://www.investing.com/technical/technical-summary" into fld 1
--------------------------------------------

I have just write the name of my application...

I'm so sorry for the inconvenience and i thank you a lot for your time dedicated to me....
Now i can work in Android!!!

Best regards,

Lestroso :D :D :D

Re: Put url or Get Url Don't Work fine in Android!!!

Posted: Sat Jan 19, 2013 3:28 am
by Simon
Lestroso,
Are you sure you can't use site?
http://touch.investing.com/currencies/
It's the currencies but set up for mobile devices so it's much faster to download. It's the same information, same provider as the site you are looking at.

Simon

Re: Put url or Get Url Don't Work fine in Android!!!

Posted: Sat Jan 19, 2013 11:33 am
by Fasasoftware
hi Simon,

For me this script:

Code: Select all

set the httpHeaders to "User-Agent: ibop" <---this works very fine!!!!!

PUT URL "http://www.investing.com/technical/technical-summary" into fld 1

work ok!!! this return the same text as in pc or mac...because i was needed to return this text ">summary:< and this do the work...

....In every way Simon. i consider your opinion it help me again...very much i will work with your url http://touch.investing.com/currencies/suggested to me by you simon... I thank you a lot for your time dedicated to me and for your help...

Thanks to everybody again.....

Lestroso :D :D :D

Re: Put url or Get Url Don't Work fine in Android!!!

Posted: Sat Jan 19, 2013 8:42 pm
by jacque
I'm glad it works now. Please close your bug report so that the engineers don't need to look at it. They will appreciate that. :)

Re: Put url or Get Url Don't Work fine in Android!!!

Posted: Sat Jan 19, 2013 9:59 pm
by Fasasoftware
Dear jaqueline,

I have already closed all my bugs reports and talk already with livecode team... All things Solved OK!!
I'm sorry again...

Thank you a lot again,

Lestroso :D