2015년 1월 3일 토요일

Using Text from Webpage

In my app, I would like to have (e.g.) in the title of the screen appears the word "Alarm" condition if the specified web page appears (contains) specified text and numbers in real time.

How do I do this???
Can you show me on some example?
I've tried different combinations of events (Web, ActivityStarter...)



Have you done the Stock Quotes tutorial?


Put that in a Clock to repeat.



Thank you Abraham for suggestion. 
It works; but now I don't know how to set word ALARM if specific numbers in text are bigger than one other text.
I was trying with Math ant Text but don't works.



Show us what you tried, by posting a screenshot of the relevant blocks.



E.g. I would like to set word ALARM if on the website http://www.arso.gov.si/vode/podatki/stanje_voda_samodejne.html by Petanjci appears Vodostaj is bigger then 150 and Pretok bigeer than 100. If these two criteria are met then should appears Alarm.
My first problem is how to achieve the first criterion.







You are trying to do too many things at the same time. First try to get hold of the values in the text returned by the website. Put the text that you receive in a global variable and then start splitting the text until you have found the right values. Look here for documentation how to split and find text: 
http://appinventor.mit.edu/explore/ai2/support/blocks/text.html
Put the results you find in two global variables and then compare them.
If, after studying this, you are still lost, post your .aia and I will help you.



Also see this doc on building a tree from XML web pages...
It would require you to navigate the resulting tree, though.

Also see
if you prefer  a homing pigeon to a coin sorter.



OK. This should work for you. What happens is that you split the text of the response to get the various values out. When you have them, you can compare.
let us know whether this is clear.




OOUUUU!

It seem that it works. Thank you very much for the help!!!!

So, when I'll have time I will study this combination of blocks and continue my project.

Thank you one more time!


댓글 없음:

댓글 쓰기