Grabbing Text from a website using xcode - iphone

what i am aiming to do is make an app that grabs text from a website and auto updates when the text on the website changes, does anyone have any ideas or any solutions that could help?

I think you can use Javascript for taken text you need. Also you can use NSRegularExpressions (but it's worse variant). For autoupdating - you should be delegate of UIWebView and check your text in didFinished… method.

Do you mean an iPhone web app? If so do the following:
<head></head><body><?php include ("pathtocontent/content.php") ?></body>
And save as e.g. index.php
Put in the content.php file:
<p>content.</p>
Or anything else you want as content.
Then in the iPhone website do the same. Then you only have to update content.php in order to cjhange both the websites

Look at NSURLConnection, send a request to the website, the data will be in the response

Related

How to Delete nodes from HTML in iOS

What I am trying to do is to load a webpage into in a UIWebView. The problem is that I need to do some preprocessing on the html before displaying it in the web view.
The UIWebview loadHTMLString is quiet slow when the html is big. I don't need to display the full page therefore i am trying to remove some html nodes before displaying it in the web view to speed up the loading time.
I don't think using regex for that is a wise idea. I checked out NSXMLParser and TFHPPLE but I couldn't find any way to remove nodes from the html tree using an XPath or something.
I know I could do that using Javascript but that won't solve my problem. I also don't have no control on the website so I can't edit in the webpage itself.
Is there something as easy as deleteNodeUsingXPath or something :)
Cheers and thanks a lot for your help in advance.
One possibility solution: do a proxy website which strips out unwanted stuff. The iphone accesses the proxy website URL. The proxy website loads from the original website, strips out unwanted stuff, and replies with the remaining stuff.
There is a tool called Objective-C-HTML-Parser that will do what you are looking for. The documentation is thorough, and the implementation is pretty straight-forward.
Basically, you take your HTML string and make an HTMLParser object that you can then manipulate however you want. It is a very powerful library that basically lets you do whatever you want with HTML with easy-to-use Objective-C APIs.
Good luck!

create hyperlink in sms in iPhone

Is it possible to create a hyperlink in an sms in an iPhone?
For example, if I want the word 'foo' hyperlinked in HTML then I'll write foo in a normal situation.
If I want to have a certain word in my sms to be hyperlinked to something, is there any way I can do this? Like "I have a surprise for you" and the receiver taps on the hyperlinked word 'surprise' which will take the user to the destined page.
Any suggestions as to how this can be done? Examples and samples welcome!
Thanks in advance :)
No, you cannot use html tags in sms / text messages. All you can do is insert the URL without the tag. It then depends on the receivers device whether the URL is presented to the user as link or as plain text.
I experimented with exactly this just yesterday. It seems you can't include a nicely formatted hyperlink, unfortunately. I hope to be proven wrong by somebody else, though :-)
However, as you've probably seen yourself, iPhone is able to recognize an URL and you can tap on it to open the URL in Safari (or tap the disclosure button next the message to get more options on what to do with the URL). As far as I can tell the only thing you can do is format your SMS accordingly: "I have a surprise for you: http://foo.com" even though that might spoil the surprise ;-)
No, you can't do this due to privacy issues. Apple thinks that giving you this ability would allow you to link users to malware and such. Sorry!
i don't think it's possible to create hyperlinks in SMS.
The only way is to send an URL, and the iPhone will convert it to a link...
Use a tiny url from tinyurl.
It doesn't allow you to do exactly what you are wanting but it at least can be used to cover up the long link.
This is the closest thing I figure out to do. I was wanting to use the "
No, you can not do this. However you could use tinyurl and format it like this
http://whateverYouWantToSay#tinyurl.com
Web browsers usually ignore anything before an # therefore you could effectively hide the actual site being linked to, as long as your friend does not know that.
What actually happens is the data before the # is submitted to the web site in the form username:password. However it must be a site that requires authentication to access, or the site will normally just ignore it.
If this helps, I've noticed that a custom hyperlink is possible on the OS X Messages app, but they have to be copied and pasted. To replicate this right click on a hyperlink in your browser and hit copy link. Then paste into Messages.
Uhhh this is possible here is a screenshot of an example - I copied a link from email and pasted in a new SMS - though it appears you cannot type html to create a link....

Access to hyperlink in a pdf(iPhone)?

I am working on a small app, which can open a pdf. My question is, if it is possible to access a hyperlink from a pdf? Because when am trying to click on hyperlink nothing is happening and it's not redirecting me to the link. I tried searching a lot but didn't got any luck on this. Am expecting a quick response as my work is getting delayed because of this issue. If it's possible then what would be the approach? Right now am using UIWebView to open the pdf. Any sample app or code will be of great help.
Thanks for your time .
The only way I know is to use a third party library (or perhaps parse the PDF yourself), find the links, get their rects and catch user taps and compare that to the list of link/hyperlinks/gotos for that particular page.
Unfortunatelly - nothing in the SDK that can help. You can search for a opensource pdf library, like muPDF for instance.
There is a reason why not many applications have that functionality :D

How do I implement a Floodlight tag into an iPhone app?

A client is asking me to insert a Floodlight tag into an Objective-C programmed iPhone app that is ready for submission to the App Store.
I did some Googling, and couldn't find anything about how to do this (it seems like you can you only add Floodlight tags via Javascript, but I'm not too sure). Can you do this, and, if so, how?
If nothing else, you can create an offscreen UIWebView and invoke the appropriate javascript with stringByEvaluatingJavaScriptFromString. Not a good solution, but if javascript is required it may be your only choice.
Instead of embedding a UIWebView right off the bat for this, you could try using NSURLConnection to request the URL normally inserted with the Floodlight iframe. It seems that unless the contents of the iframe (which should just be a transparent GIF) need to interact with the host page, simply performing and receiving the request should fulfill the purposes of tracking. Check the ToS, though, to see if they have any stipulations about this.

Grabbing articles from my Wordpress site then using that in a UITableView?

As the title says I'm currently trying to grab the posts from my Wordpress site and then load it into a UITableView so It can be viewed like that. How would this be done? Im assuming Im going to have to use XML but how..? I'd rather try RSS if I can? Or what ever way works!
Thank you so much for helping!
RSS is the way to go... You can use a XML Parser to parse the RSS feed and display them. I'm not sure whether you are aware of this.
http://iphone.wordpress.org