Parsing Injected Web Page Data - iphone

Trying to create an iPhone app (Objective-C) for my school. I want it to search for, and then parse any emergency announcements on the web page. They do not occur in the HTML, and are probably written in with PHP or another server-sire language. Any way i can access that information? (Link: http://www.ridgefield.org/)

I recommend that you parse http://www.ridgefield.org/ajax/dist/emergency-announcements as this is the address where the website fetches the info.
Next time you could use the Firefox plugin Tamper Data found at https://addons.mozilla.org/en-US/firefox/addon/tamper-data/. Try it out!

Related

How to scrape Facebook friends' info INCLUDING their real e-mail the way Facebook App does?

I recently found that Facebook App (for Android & iOS, but i'm using Android anyway) downloads almost all friends' information (including FB ID and real e-mail account) to a SQLite database called fb.db. I am trying to do the same thing programmaticaly (using python, perl, bash etc) but with no luck so far. I need a way that will do similar requests with FB APP, and will download all of my friends' info upon login, just like the way FB APP work.
I tried so far to:
Decompile com.facebook.katana and see how it's done - No luck (or just missed it).
Sniff the facebook app with burp - No luck (due to SSL and app's protection when certs have been changed)
I am sure you went through this: http://developer.android.com/guide/topics/data/data-storage.html#db
There it is stated:
Android provides full support for SQLite databases. Any databases you create will be accessible by name to any class in the application, but not outside the application.
It was not the answer, it was just a text, which states that you can create a database for your web app. But unfortunately they are not providing any kind of helping material about writing and removing the data from that Database. So lets move to another source!
Related posts:
Please read this:
How to insert data into SQLite database in android?
There is a sweet example of how to add the content to a database in Android.
There is another example on this question too, Downloading data/content into Sqlite database
Why they didn't work:
Decompiling won't work! As they might have editted the app to be only fb-developer-readable on the first place. So you will never have success this way.
And the second thing is same.
All you can do, is to guess the algorithm or ask for it here: http://programmers.stackexchange.com and give it a try from scratch! :)
Suggestions:
I would try to recommend you to first learn how to:
Access Data connection on the phone.
Access the server from where to download the data.
Create a string or what ever data type to be inserted in database.
Create the connection, and save the data there!
I would now assume that you are a beginner, and want a tutorial! Then the first guess could be to visit their own project sites (SQLite, Android). Visit the developer network. And look for what you get!
Good luck buddy! Cheers.

How do I update the content of my app without releasing another version?

I have an app that basically has news and updates about a certain subject. How do I get it to work that when I update something let's say in my website it would also update what's on the app. Do I usee RSS for this?
You need some web service to deliver the data. In terms of what format a web service can use, there are a variety, but two prevalent formats are XML and JSON. RSS is, essentially, a particular form of XML.
On the iOS side, you can parse XML using NSXMLParser (see NSXML Parser Class Reference). If you're parsing JSON, you can use NSJSONSerialization (see NSJSONSerialization Class Referece). For both of these, you can google the class keyword followed by "example" or "demonstration" (e.g., "NSXMLParser example" or "NSJSONSerialization demonstration") and you'll see tons of examples. If you have an RSS feed, you can google something like "iOS RSS example".
It may be dictated by what you can easily render from your server, XML (or, in particular, RSS) or JSON. For example, if you're using some content management system on your web site, it might offer RSS feeds, or something like that. In the absence of that, you may have to write your own server interface to retrieve the data in XML (or RSS) or JSON formats.
In addition to #Rob answer I would point couple mode things:
You can simply prepare databases with your information (like SQLite) and just download them from your web site to your application.
You need to have some way of notifying application about new content and for that you might want to use remote notifications. http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html - this way you can send notify messages to your app, and user will know that there is something new to download and read.

Connect existing Drupal page with PhoneGap iOS App

Case:
I have an existing page based on Drupal and going to develop a phoneGap iOS App. That means I just need the information of the existing page and want to fill these data in the new app.
My Question is now, do somebody know weather there is a work around or work flow to do so resp. how can I connect the existing page with another page or in my case phoneGap to get just the data? I'm new with Drupal and phoneGap so maybe you have some pages with information, tutorials or some help how to do this.
Thanks in advance yves
Drupal offers a module called "Services" which will allow you to get data or services from your website. You may need to create your own methods on that module to get the information you want to retrieve.
As for the iOS side, you can retrieve the data via XML-RPC, Rest or whatever communication protocol you choose at the server side, or go all the way with drupal-ios.
https://github.com/workhabitinc/drupal-ios-sdk/
You should start looking for the Services module and play with it. You will have an embedded console on that module to test the methods.
Once you're finish with that, take a look at drupal-ios or go deep with your own implementation via XML-RPC or whatever.

How to create a news like iPhone app that updates weekly

I have created a few small apps for the iPhone so I have some experience. An organization that I'm in asked me if I could program a weekly newsletter app for them. I though it would be a good challenge so I agreed. My question is: how do I get the app to update weekly without the users having to re-download or manually update? Do I connect to a database or a website? Can anyone send me the link to a good tutorial? I wasn't able to find one.
Thank you!
Your question is very general but I could give you some suggestions.
First, you need to connect to a service that provides you news info. This is needed. The service could send you an xml that you can parse and display, for example in a UITableView. XML is not the only solution. You could use also JSON.
For parsing XML I suggest you to read GDataXML, while for JSON JSONKit framework. But there are also other valid framework out there.
Then, to save data it depends on what kind of data you deal with. Here you could find different ways to save your news. Save an XML that contains your news, serialize data and save them in the local filesystem or use Core-Data.
To update your news without user actions, you have to save the last time when the app has downloaded news (for example in NSUserDefaults) and each time time the application is "activated" check for that date and update news if necessary.
Out there there are plenty of tutorials on how to (in parenthesis I inserted classes or framework that you could have a look):
consuming web service on iPhone (ASIHttpRequest - no more supported, NSURLConnection class, AFNetworking)
dealing with XML file/data and theirs parsing (GDataXML, touchXML, etc.)
dealing with JSON messages (JSONKit, etc.)
managing documents (NSFileManager class)
using Core-Data
using Property-List and/or NSUserDefaults
First three cover the first step (download). Other three cover the second one (save). Obviously you have not to use all of them. For example a configuration could be:
NSURLConnection for service, GDataXML for parsing XML data and Property-List for save data.
Hope it helps.
A simpler approach would be to make it a pure web app and update the website weekly.
Your content providers are going to have to do those updates anyway.
Check: Adding Newsstand Support to Your App or Tutorial: How To Make Your App Work With The Newsstand

Obtaining information from Webpage - displaying it in an Iphone app

Is it possible to pull information from a website and display it in an iphone application?
I am looking to pull the current temperature and barometric pressure for an airport from the http://adds.aviationweather.noaa.gov website and display those two pieces of information in an app.
This sounds like a common task that programs do all the time but I'm not sure how it's incorporated into an app.. (what is the process of pulling webdata called?)
What methods or tools are available to do this? I am unfamiliar with handling web data for iphone at this time.
If they have an actual feed for the data, you could access it using NSHTTPRequest and parse the results.
If you need to screen-scrape the data off the page itself, then I would highly suggest creating your own web service to do the parsing and have your iPhone app talk to your web service. The reason being that if they update the page in a way that breaks your screen scraping you would only have to update your web service instead of deploying an update out to who-knows-how-many iPhones.
Just use an NSHTTPRequest and all the related classes to assemble a standard HTTP GET request for the site with the data you need. If there's a data feed (XML, JSON, etc.), you should find out what that URL is and use it instead of parsing the actual HTML of the web page. If not, the method is called "screen scraping" and it basically involves you writing a regular expression to parse the HTML of the web page returned from the server. Again, don't do this unless there is no alternative data feed you can use.
If you need to parse XML, see NSXMLParser. There are open-source solutions for parsing JSON in Objective-C. Just Google around for them.