What's a good way to "standardize" the format of web content for importing into an app? - ios

I'm working on a project where one of the requirements is to import articles from a website. The problem is that different websites have different formats. I could theoretically write some code that strips out extra content from known websites, but this is hardly maintainable. It sounds like there should be something already out there that can "RSS-ify" pages for me into some format, so that I can easily import content.
Is there such a service that I can just "plug" any website into? Also, what are my options here in regards to importing web content into an app, aside from this? How would you handle it?
Edit: Two things that come to mind are FeedBurner and Apple's Safari browser, which adds an "RSS" button. (Safari Mobile actually does one better and renders a neat read view in iOS 5.) Are they relevant to this question in any way?

It seems that there is none. The best I can do is work with content providers to offer RSS feeds and such.

Related

Big Picture — What sort of feed for an iOS news app?

Alright — this sort of question shows my naïveté but I am asking it nonetheless so I don't venture down the wrong rabbit hole while trying out this app.
I'm making what amounts to a news app. Imagine taking a Wordpress blog and fitting it to iOS. Now, here's my question — what sort of feed / architecture should I be using to push information from my Wordpress server to my app? I would assume RSS using AFNetworking, but that seems to cause some rough edges, and all tutorials that I see end up pushing to a web view instead of a scrollview with nice, rendered text. Plus, none of the same tutorials seem to have anything further than the initial feed (loading more than the initial 10 stories given, for example).
I've already committed a few hours to trying the RSS / AFNetworking approach, but is there a significantly better alternative that I just haven't come across. (Note that I do have access to the back-end of my Wordpress site, i.e. it isn't somebody else's)
If you are building an iOS app that connects to WordPress, I suggest you to access the website data by an API instead of feed, then you can hit the API from your app and manipulate the data as you want.
If you have access to the WordPress backend, check the Thermal API which is a plugin that will probably solve your problem.
Cheers,
I would suggest that you look at https://wordpress.org/plugins/json-rest-api/ this is to be added to the core of wordpress so it would seem that is the way to go I think.
By the way I am working on the same type of thing as you.
I think the most popular Wordpress API is the one that comes with Jetpack. You can find its documentation here: https://developer.wordpress.com/docs/api/
If you just want read access, then i think the easiest way to do so is by using: https://github.com/evermeer/AlamofireJsonToObjects/blob/master/AlamofireJsonToObjectsTests/WordpressTest.swift
If you also want write access, then you have to implement Oauth2. For that you can select a library from: https://cocoapods.org/?q=oauth

How iOS Google Now can show different card template

I wanted to know the technology decision behind the iOS Google app.
As we can see, in the app's Google Now feature it renders many different card templates for different scenarios, and those templates seems to be very flexible based on server inputs.
I was wondering if this is implemented all based on HTML5? or they just have many templates built in and render them locally? I'd vote for the HTML5 route but not sure if this still involved some native code to make it more responsive?
Thanks!
As we (well, most of the community) are not Google employees we can't tell you what they really did, but I'd say that it is possible to do this dynamically in the app.
We did develop something similar that responds to definitions sent by the server and transforms them to custom designed forms following basic rules.
Google reuses the design of those cards for different plattforms, the easiest solution should be showing some WebView and using HTML5.
I agree with Kevin, as this answer is entirely based on personal opinion, too.
The way I would go is to create a card class which will load some JSON data and format it with HTML and CSS. Looking at each card it would be hell to format things that way natively. I mean, attributed strings is not the way to go. Too much logic for deciding which card get a bigger text or a picture.
Additionally, the top header is most likely "localized" as well, so you get the location and load a localized image. But that is Google by nature.

How to implement an interactive PDF in iOS

Here im hitting my head againt the wall.
My client provided a pdf with buttons(just like buttons,when user tap on button,it will load next page and previous page etc.).
This buttons will work only when we open it in adobe reader.
I tried the QLpreviewview,quickview but it is not working,all what i can do is just to load the pdf in the webview.
Can anyone please help me in how to load an interactive pdf in iOS.
Thanks in advance.
Have a look at PSPDFKit, it is the most advanced framework I've found for PDFs in iOS. They have an impressive list of customers as well.
It is a bit pricy though, but you have the option to get the Source Code too if you need to modify anything. Could be worth it if your client need that kind of performance and other features as well.
(I am not in any way affiliated with PSPDFKit)
The limitations are due to the capabilities (or non-capabilities) of the PDF viewer used.
Currently the leading PDF viewer on iDevices is PDFExpert by Readdle. Adobe Reader for iDevices is weaker, but can deal to some extent with form elements.
For page navigation etc. you might use links instead of button fields (as far as you can live with the capabilities of links, and not use JavaScript). Links are said to be handled properly with many PDF viewers.
You may have to require certain PDF viewers on instructional level, because you don't have control over the viewer used by the actual user. And, as you noticed, many PDF viewers are simply too dumb do deal with active elements.
Another approach would be looking at PDF-to-HTML5 converters, and serve HTML5 from a server.

Web Source into NSString

How could I access a website and turn components of the website into strings. For example taking information from Facebook posts. I have done a little searching but can't find any good tutorials or anything useful.
Try looking at this tutorial. It should get you more familiar on the subject and start you off on the right track.
As it states at the beginning of the tutorial...
How to Parse HTML on iOS
Let’s say you want to find some information inside a web page and
display it in a custom way in your app. This technique is called
“scraping.” Let’s also assume you’ve thought through alternatives to
scraping web pages from inside your app, and are pretty sure that’s
what you want to do. Well then you get to the question – how can you
programmatically dig through the HTML and find the part you’re looking
for, in the most robust way possible? Believe it or not, regular
expressions won’t cut it! Well, in this tutorial you’ll find out how!
You’ll get hands-on experience with parsing HTML into an Objective-C
data model that your apps can use.
http://www.raywenderlich.com/14172/how-to-parse-html-on-ios

Making a firefox/chrome extension from 0

i have a website, its to exchange links, files... to say it quickly it's my 'version' of twitter+megaupload,
Well, users add links all the time and so on, but i would like user be able to syinch his bookmarks from the browser to the ones he has at his profile of mywebsite,
Where should i look into?
Basically i need to be able to:
- Acces bookmarks file (1)
- being able to send the urls to my service ( 2 )
- maybe adding the login feature (in the future)
I was google'ing about this for ages few weeks a go and i kind of give up, because i'm ok with PHP and JS, but with this plugin languages i'm very lost. So i decided posting here, wich always brings positive answers
(1) - > I don't even know where to start
(2) -> i was thinking to have a website.com/auto_import_no_confirm.php?url=[URL] and put it in a for each.
how many different languages and extension files do i have to work with? I really need any kind of tip with point (1)
feel like?
-edit-
Just found This -> https://developer.mozilla.org/En/Code_snippets/Bookmarks
wich really looks like i need, but where do i place this code?
thanks!
Might not be a bad question, but there are too many subtopics raised to answer that. (And there is too much tagspam as well. Break up your question into PHP- and Javascript-specific tasks, when you have devised the general application scheme.)
But to get started, download similar Firefox extensions (.xpi) and unzip them to inspect the general structure. You'll find examplary code for bookmark handling and invoking remote APIs pretty quickly. And basically you only need Javascript for the extension itself. (It sounds like your extension does not need much UI.)
And there are many tutorials on designing Firefox addons: http://roachfiend.com/archives/2004/12/08/how-to-create-firefox-extensions/ or http://www.google.com/search?q=firefox+develop+an+xpi
The good news first, you won't need much more than javascript if you just want to access bookmarks and send them to a server, neither on firefox nor on chrome.
But still you'll have to make yourself familiar with the apis of the browsers and learn how to develop extensions.
However, both Mozilla and Google provide all necessary information on their developer sites.
For Chrome, this is a good place to start, you'll find the api for bookmark access here.
The Corresponding site for Firefox can be found here, with information on bookmark access here.

Resources