ios load content from website - ios

I want to create native iOS app, which must display static content of some website (for example, news website). I just need to display news categories, articles' text and images in my native iOS app.
How is it better to get content of website? What is the usual way to do that?
Ask website's developers for website's api? Or using some iOS SDK tools to get web content?
Thanks for help!

Asking the webmaster for the API is the best and easiest way, if they provide.
You can get the specific content you need via crawling script
written by Python. Run the python script on your own server to fetch
the articles under news category over and over, analyze the content
and extract the useful part, finally provide your own API for your native iOS app. This costs more.
Straightway, create NSURLRequest to load the webpage content, and do
the analysis task on the client instead. This affects the user experience.

You can use an UIWebView to load websites.
If the developer provides you a website API with XML or JSON you can create a UITableView with the news titles and a UIViewController to load the news details, but I don't think any developer would do it for you.

Related

Taking data from website such as most recent blog and use it in iOS app

I am a new developer and have a client who wants to have a view with a most recent blog. I really have no idea on how to take information from a website, but i definitely want to learn how to do this. I'm not sure on how to approach this. The client has a mobile website so would it be practical to just use a web view? Will the client need to be change their website for me to pull the most recent blog and other things. Is it difficult to take the information from the website?
I suggest that you check out teamtreehouse website. They have a course called "Build a Blog Reader iPhone App" It will teach you all the basics of how to pull data using JSON and display it in tableView.
The blog probably has an RSS feed. You can pull that RSS feed using MWFeedParser and put it into a UITableView

How Can I Incorporate my WordPress Blogs into an iOS app?

How Can I Incorporate my WordPress Blogs into an iOS app? I have a beautiful word press site and I want to create a native iOS app. I have knowledge of coding for iOS, but I just don't know how I would go about showing all the latest blogs that are up in a beautiful way.
Thanks in Advance!
There are many ways you can achieve that. Here is a list of things you need to do in order to make an iOS app for your WordPress blog:
1) You need to parse the data from your WordPress blog to display it inside your iOS app. You can do it by parsing your blog's RSS feed you can parse JSON.
2) If you are planning to parse the RSS feed, use NSXMLParser to do that. There are other third party libraries available that parse the XML feeds but i would suggest to go with the built in NSXMLParser as there is plenty of help available online for it.
3) If you are planning to parse JSON data, install Feed JSON plugin on your WordPress blog. Once installed, you can go to http://example.com/feed/json to get the JSON data. (You can replace example.com with your blog's URL)
4) To connect to the web services like XML feed and JSON on your blog, you can use third party libraries like AFNetworking or you can use Apple's built in libraries like NSURLConnection and other classes to connect and download the data from the webservice.
5) Here are some very easy tutorials for the steps above. How to Use NSURLConnection, How to fetch JSON or How To Parse RSS with NSXmlParser
You can start your app by completing the above steps and getting started.
6) After that one of the most important thing is to download images asynchronously in the UITableViewCells where you are displaying your blog posts. I would suggest you to download a video from Stanford University's iOS programming course on iTunes U that shows how to do it or you can simply find some tutorials or look for questions on StackOverflow.
7) Then you have to create a UIWebView and when the row of any blog post inside the UITableView is tapped, you can use the link to segue in the UIWebView to show the actual blog post. You can use didSelectRowAtIndexPath in order to pass data between view controllers.
8) Below the view controller that contains the UIWebView, you can add functions like stop, refresh, sharing on Facebook and Twitter etc.
9) As you can see that is a lot of work and business people just think that its easy to develop an iOS app but the truth is that it takes some time to completely package the app and submit to the App Store. You can also outsource your project by using service like Convert WordPress Blog To iOS App that is completely for free if you share revenue with them but its your choice and i recommend you to code it yourself to have complete ownership of you app.
Rest is just a matter of choice of different functions you would like to make in your app to stand out from the rest. You can add a Facebook style sliding navigation controller on the left side to create and parse specific categories on your blog, you can use Flipboard style swiping in your Web View etc etc. For that stuff there are a lot of third party libraries available.
Hope this helps!
You can read an answer of mine about cloud based ios apps (the db is online) here:
press me
now as i said, to get info from the server you need to use JSON, in wordpress there is a very good and simple plugin for that: JSON API
now the use of that is simple, you can see it in the notes: http://wordpress.org/plugins/json-api/other_notes/
but for example for getting the last posts in the system you need to run the url: http://www.example.org/api/get_recent_posts/
The /api means it's the plugin (you can change that in the settings) and the /get_recent_posts/ is the function.
there are many other functions like this one for everything you need and it can get more complicated than that based on what you want to get from the db.
After running the "query" and getting a response in JSON you need to use it:
Working with JSON in iOS 5 Tutorial
now for the running of the url i recommend to use AFNetworking
now all you need to do is use the json string you get for getting out info.
this would have some more issues like managing html codes you get in the content respons and so but it's the start, develop your way up :)

How to access Wordpress posts/data in an iOS app

I am writing an iOS app for a web site. This site is built using Wordpress. I have the overall UI structure built but I don't know I can connect to the sites server to get the needed data (posts, post titles, etc) to display through the app.
How can I do this?
To start, if the site is configured in the usual way, you can add ?feed=rss2 to the URL of your WordPress-driven site to request an RSS2 feed.
Basically, you're going to NSURLConnection and the URL Loading System to fetch the RSS feed, and then parse it. You can then use NSXMLParser to read the feed, and turn it into data collections and/or model objects to hold the data. Your UI can then load and display that data as you like.

iOS Image search on the web

I am developing the functionality of letting the user search the internet for images through any query.
There are services/APIs like Google's (I read that it is deprecated), Yahoo and Bing etc. I want to know, is there any FREE services/APIs/frameworks/libraries for iOS to search for images against any query?
We can fetch the thumbnails against the results URL and populate a grid-view to show the thumbnails. Then download the actual image in the App once the user clicks on a particular image. Is there any such service that is free?
Thanks
you can use flickr, in the Ray Wenderlich site you have a good tutorial of how to use it. About the services you mentions I don't know if the has a public (free) API

Follow and Scrape Links In Tweets with Rails

I'm currently parsing twitter feeds through my rails app and wondering how it would be possible to follow links in the tweets and scrape the external content (for example, if the tweet contains a link to an article on TechCrunch, follow that link to the article and scrape the title and body content of the article). Flipboard for iPad is a perfect example of this.
I'm familiar with screen scraping using Nokogirl / Mechanize, but trying to figure out how to accomplish this in a way it could work regardless of where the link in the tweet is linking to (whether it be to TechCrunch, or Flickr, etc...).
Any thoughts / insights would be much appreciated!
Many of the major content providers provide a oembed endpoints. Take a look at the oembed_links gem. From the readme:
It allows you to easily parse text and
query configured providers for embedding information on the links
inside the text. A sample configuration file for configuring the
library has been included (oembed_links_example.yml), though you
may also configure the library programmatically (see rdocs).
If you use oembed_links in conjuction with http://oohembed.com/ you'll have dozens of content providers handled for you. You can easily write a custom provider to handle the rest.

Resources