webOS Nation Forums >  webOS apps and software >  webOS development > Making fake programs is fun :)
Making fake programs is fun :)

  Reply
 
LinkBack Thread Tools Display Modes
Old 07/05/2009, 09:24 PM   #101 (permalink)
Member
 
SirataXero's Avatar
 
Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
Default

Quote:
Originally Posted by mattbrad2 View Post
Btw, you guys may want to take a look at this site:

www sergiopereira com/articles/prototype.js.html#UsingAjax

Prototype has some cool AJAX wrapper classes that should help simplify the process.
Hey mattbrad!

That's an AWESOME link! That's exactly what I was looking for to learn Ajax functions! Thank you!

Lemme know if you figured it out, or if you need more help with the slider functionality... I can try to help you out on that if you still need help.

Good Luck!
SirataXero is offline   Reply With Quote
Old 07/06/2009, 01:23 AM   #102 (permalink)
Member
 
Join Date: Jun 2009
Location: Chicago
Posts: 316
Likes Received: 0
Thanks: 32
Thanked 166 Times in 26 Posts
Default

this thread has motivated me to make my own apps. check out my tic tac toe one in the homebrew section. any advice from the people in this thread would be appreciated
kmax12 is offline   Reply With Quote
Old 07/06/2009, 10:02 AM   #103 (permalink)
Member
 
Join Date: Jun 2009
Posts: 73
Likes Received: 0
Thanks: 5
Thanked 7 Times in 6 Posts
Default

Hey Guys, I wont be working on my app for a while, my laptop is out of commison. I broke my screen. gonna fix it
murdermajig is offline   Reply With Quote
Old 07/06/2009, 01:19 PM   #104 (permalink)
Member
 
SirataXero's Avatar
 
Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
Default

Quote:
Originally Posted by kmax12 View Post
this thread has motivated me to make my own apps. check out my tic tac toe one in the homebrew section. any advice from the people in this thread would be appreciated
Hey that's awesome! I'll install it to my SDK right now and let you know what I think!

Quote:
Originally Posted by murdermajig View Post
Hey Guys, I wont be working on my app for a while, my laptop is out of commison. I broke my screen. gonna fix it
LOL. That sucks! I was out of commission for three days during the weekend (trip, so no internet) and it was harsh! Hang in there!

haha

so I just found out for sure that any website you want to access with the Ajax calls needs to support it and needs to "post" said Ajax components which can then be received by clients (i.e. your app). *SIGH*. So lame... I guess I might end up doing a "webview" widget for my app... we'll see...
SirataXero is offline   Reply With Quote
Old 07/06/2009, 01:30 PM   #105 (permalink)
Member
 
Join Date: Jun 2009
Posts: 179
Likes Received: 0
Thanks: 14
Thanked 24 Times in 9 Posts
Default

Anybody want to throw me a link teaching me how exactly to put the appsi make onto the pre sdk? Can't seem to figure it out, just want to test out the hello world app.
davenukem is offline   Reply With Quote
Old 07/06/2009, 01:44 PM   #106 (permalink)
Member
 
Join Date: Jun 2009
Posts: 73
Likes Received: 0
Thanks: 5
Thanked 7 Times in 6 Posts
Default

I have a second laptop (netbook) But i dont think i want to reinstall the SDK on my netbook. too cramp to work long time.
murdermajig is offline   Reply With Quote
Old 07/06/2009, 01:46 PM   #107 (permalink)
Member
 
SirataXero's Avatar
 
Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
Default

Quote:
Originally Posted by davenukem View Post
Anybody want to throw me a link teaching me how exactly to put the appsi make onto the pre sdk? Can't seem to figure it out, just want to test out the hello world app.
Hey... here's a short quick tutorial:
Code:
1. open up command prompt (start -> type in "cmd")
     1a. right click and run as admin if you're on Vista
2. type cd .. until you get to the "C:/>" directory
3. Type in cd Palm/SDK/share/tutorial
     3a. This is assuming you installed the SDK directly on your C drive and not
          in a folder or in Program files
4. type in:
     
Code:
palm-package HelloWorld (hit enter)
palm-install com.yourdomain.helloworld_1.0_all.ipk (hit enter)
5. This SHOULD get your app loaded into the emulator, you shouldn't need to restart the emulator or basically do anything else... If this doesn't work: Check to see you have all your directory's correct. Change any in the command prompt that you might need to correct for your specific install case.
Let me know if that works. Post back here and tell me if it worked for you or not...
SirataXero is offline   Reply With Quote
Old 07/06/2009, 04:10 PM   #108 (permalink)
Member
 
Join Date: Jun 2009
Posts: 30
Likes Received: 0
Thanks: 4
Thanked 2 Times in 2 Posts
Default

Hey Sirata, maybe you can web scrape/screen scrape for the data you want from the site instead? I've never done it but I know friends who have had to use such techniques to get the data they needed. I don't have too much knowledge more to offer on it but I am sure there is a lot of info on the web.
schoksi is offline   Reply With Quote
Old 07/06/2009, 04:23 PM   #109 (permalink)
Member
 
SirataXero's Avatar
 
Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
Default

Quote:
Originally Posted by schoksi View Post
Hey Sirata, maybe you can web scrape/screen scrape for the data you want from the site instead? I've never done it but I know friends who have had to use such techniques to get the data they needed. I don't have too much knowledge more to offer on it but I am sure there is a lot of info on the web.
Hey Schoksi,

Thanks for the suggestion! I figured I might just end up doing that. I REALLY wanted to pull out the data and format it into a really nice, clean looking, Pre formatted table... but I might just end up doing it the "ghetto" way... we'll see... I'm kind of busy working right now... I'll start looking into it more later tonight. I will definitely post my progress up here for any "noob" like me who wants to try it.
SirataXero is offline   Reply With Quote
Old 07/06/2009, 05:23 PM   #110 (permalink)
Member
 
Blubble's Avatar
 
Join Date: Jun 2009
Location: Silicon Valley, California
Posts: 1,025
Likes Received: 0
Thanks: 37
Thanked 444 Times in 161 Posts
Default

If you want to scrape pages, you will want to learn about regular expressions in JavaScript. That is a method for finding patterns in text. For example, if you could figure out that the particular piece of data you want is always formatted a certain way, you could use regular expressions to find and extract that data from the source HTML of a web page.
Blubble is offline   Reply With Quote
Old 07/06/2009, 05:36 PM   #111 (permalink)
Member
 
SirataXero's Avatar
 
Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
Default

Quote:
Originally Posted by Blubble View Post
If you want to scrape pages, you will want to learn about regular expressions in JavaScript. That is a method for finding patterns in text. For example, if you could figure out that the particular piece of data you want is always formatted a certain way, you could use regular expressions to find and extract that data from the source HTML of a web page.
Well, the data I want is always in a table on the side. So are you saying, I could "scrape" the webpage, find this exact data, extract its contents and then display them with a formatting of my own choice?
SirataXero is offline   Reply With Quote
Old 07/06/2009, 05:53 PM   #112 (permalink)
Member
 
Blubble's Avatar
 
Join Date: Jun 2009
Location: Silicon Valley, California
Posts: 1,025
Likes Received: 0
Thanks: 37
Thanked 444 Times in 161 Posts
Default

Yes. You would look for a pattern that you could match in the HTML source of the page.

Say you're looking for name of a product from a site that let's you search by model number. If for example, the product name was always contained in a table cell with a unique format, you could try to match that pattern.

<td class="someclass">Bike Helmet</td>

You could look for a pattern like <td class="someclass">*</td> and extract your text out of the piece of HTML source that matches your pattern. You need a good tutorial on regular expressions. They don't actually use an asterisk as a wildcard. There are certain codes for letters, numbers, symbols, whitespace, etc.


Another option would be to parse the DOM of a results page. If you can figure out exactly where a piece of data will show up in the DOM structure of a webpage, you can just do a getElementById (if it has a valid ID) and pull the value of the element. You can also just get to an element via it's DOM hierarchy.
Blubble is offline   Reply With Quote
Thanked By: SirataXero
Old 07/06/2009, 06:14 PM   #113 (permalink)
Member
 
Join Date: Jun 2009
Posts: 73
Likes Received: 0
Thanks: 5
Thanked 7 Times in 6 Posts
Default

So what your saying Blubble is that you want to view that webpage but with only certain text from the webpage, right?
murdermajig is offline   Reply With Quote
Old 07/06/2009, 06:42 PM   #114 (permalink)
Member
 
Blubble's Avatar
 
Join Date: Jun 2009
Location: Silicon Valley, California
Posts: 1,025
Likes Received: 0
Thanks: 37
Thanked 444 Times in 161 Posts
Default

You want to view the HTML source of the page. The idea is to use either pattern matching with regular expressions or DOM (Document Object Model) techniques to analyze the HTML source to find and extract a particular piece (or pieces) of data. The best approach depends on the makeup of the particular page you are trying to scrape.
Blubble is offline   Reply With Quote
Old 07/06/2009, 07:14 PM   #115 (permalink)
Member
 
Join Date: Feb 2009
Posts: 25
Likes Received: 0
Thanks: 1
Thanked 10 Times in 2 Posts
Default

Quote:
Originally Posted by SirataXero View Post
As for WebOShelp.net... I'm not sure if you have the SDK leak or not, but if you go to:
Code:
...Palm\SDK\share\framework\javascripts
You will see a list of .js files that have a lot of information in the comments before the actual code begins. These comments are literal, detailed instructions on how to set up each function, how to call it and how to implement it into your code. If you could somehow compile all these instructions that would be AMAZING. As of right now, its sort of a hassle to go through each file to find information on which Widget you want to use and how to use it and such... I saw on WebOShelp you guys have started building a good collection of all the functions, Widgets, APIs and such for reference, but besides listing them, it doesn't do much else. So if WebOShelp could be a good reference place where all those instructions are listed and compiled ready to be searched through, that would drastically cut down coding time.
Thanks for the feedback!

We're definitely looking into doing this. However, we may end up having to rewrite a lot of it to avoid "distributing" or "reproducing" Palm-owned materials. I'll keep you guys updated.
__________________
webOShelp.net - A community for webOS developers - Tutorials, Forums, News and more!
ken@weboshelp.net is offline   Reply With Quote
Old 07/06/2009, 07:18 PM   #116 (permalink)
Member
 
SirataXero's Avatar
 
Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
Default

Quote:
Originally Posted by Blubble View Post
Yes. You would look for a pattern that you could match in the HTML source of the page.

Another option would be to parse the DOM of a results page. If you can figure out exactly where a piece of data will show up in the DOM structure of a webpage, you can just do a getElementById (if it has a valid ID) and pull the value of the element. You can also just get to an element via it's DOM hierarchy.
Hey Blubble, thanks for all your help! I'm just about to start looking into DOMs and HTML scraping. I looked up scraping a little bit and seems to be exactly what I need! I guess knowing HTML/Java Definitely would have helped a lot before jumping right in. lol. Personally, I find it more fun to figure out exactly what I need and ask the forums for questions about things I don't know.

Thanks!

Quote:
Originally Posted by ken@weboshelp.net View Post
Thanks for the feedback!

We're definitely looking into doing this. However, we may end up having to rewrite a lot of it to avoid "distributing" or "reproducing" Palm-owned materials. I'll keep you guys updated.
Hey Ken, I figured there might be some problems with that, but I'm sure you guys can figure it out. I really hope you're able to keep a well organized library of all the functions, that would help a LOT. Good luck!
SirataXero is offline   Reply With Quote
Old 07/06/2009, 09:30 PM   #117 (permalink)
Member
 
Join Date: Jun 2009
Posts: 73
Likes Received: 0
Thanks: 5
Thanked 7 Times in 6 Posts
Default

web scraping tutorial
Web scraping tutorial : CodeDiesel
murdermajig is offline   Reply With Quote
Old 07/06/2009, 09:35 PM   #118 (permalink)
Member
 
Blubble's Avatar
 
Join Date: Jun 2009
Location: Silicon Valley, California
Posts: 1,025
Likes Received: 0
Thanks: 37
Thanked 444 Times in 161 Posts
Default

That tutorial will help some, especially the firebug part. However, you will need to learn how to manipulate and parse the DOM using javascript.
Blubble is offline   Reply With Quote
Old 07/06/2009, 10:20 PM   #119 (permalink)
Member
 
SirataXero's Avatar
 
Join Date: Nov 2007
Location: Rhode Island, USA
Posts: 1,739
Likes Received: 15
Thanks: 381
Thanked 398 Times in 217 Posts
Default

Oh awesome! Thanks guys! I really wanna start doing this but I promised a couple people that I'd help them with their apps... so that's what i'm working on right now. >.<.

You know, the tutorial uses Firebug to inspect the code, you don't even need to do that? On firefox you can just highlight something and click "View Selection Source" and it will give you the HTML code for that item, or you can just right click anywhere and hit "View Page Source". Isn't that basically what they're using Firebug in the tutorial for?

And Blubble, yeah I noticed that I didn't quite catch the calls and specifications given to the scraping function... so I guess I have to look into that as well... YARG... soon...

>.<

Thanks for all your help guys!
SirataXero is offline   Reply With Quote
Old 07/06/2009, 10:27 PM   #120 (permalink)
Member
 
Blubble's Avatar
 
Join Date: Jun 2009
Location: Silicon Valley, California
Posts: 1,025
Likes Received: 0
Thanks: 37
Thanked 444 Times in 161 Posts
Default

Looking at the source is fine, but if you don't understand DOM structure well, Firebug can be very helpful. I know that some of my designers at the office rely on it a lot when they are working on HTML/CSS.
Blubble is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0