adding a "last updated" to a "static" home screen - iphone

My iPhone app has a home screen, with icons to various sections of the app. One of them opens a webview containing a simple tumblr blog. I'd like to be able to display the blog's "last updated" date underneath the icon. Not a super complex request...any ideas on doing this simply and easily?
Thanks!

Do you update the tumblr blog through the UIWebView or through a web service from your app? If from your app, then you know when the update was done and can store it in user defaults or some other place, and use that in a UILabel. If its from the web, then you wont know because it will have happened without any side effects to let you know of the update. If that is the case, you might see if there is a web service that lets you fetch the last update time and use that web service to get it and update your label that way.

Related

Facebook Tabs - Difference between apps vs tabs

I have recently inherited the Admin/developer role for our page and I am new to Facebook Development. I am attempting to add a new tab to our page and the only option I am getting is to build an App but all of the App options I come across make it sound like it's trying to do more than what I want it to do.
What I want to do is produce a tab on the page. That will link to an app/canvas displaying an image that the user can click to go to our offer.
So far I've built a basic app with Display Name, namespace, Page Tab Name, Page Tab URL and a Tab image. but when I refresh my page I do not get a new tab and when I preview the app page it is not the format I am looking for.
I've tried going through the tutorials but since this is all new to me I ahve yet to make any sense as to what I'm looking for or missing. Could anyone let me know what app format I am looking for? Or am I in the wrong place entirely?
You need to explicitly add an app to a page. Not sure if you've tried it or not but navigate to:
https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID
&display=popup&next=YOUR_PAGE_TAB_URL
Replacing YOUR_APP_ID with your app id and YOUR_PAGE_TAB_URL with the url you set for you page tab.

Facebook Dev: What is this?

Okay so for this page:
http://www.facebook.com/ESPN?sk=app_224097940938597
Which appears on the left hand bar between ESPN Fanwhich and ESPN Live Chat.
That isn't a canvas but it isn't a static page that I can gather. I found this tutorial: http://www.kimwoodbridge.com/how-to-add-a-custom-tab-to-a-facebook-fan-page/
But that is creating static content.
What I'm wondering is how I can create a dynamic page within a tab?
To create a "dynamic" page within a tab is pretty easy. Install the Developer's App and create a new application. There are tons of posts all over google about creating new Facebook apps, so you should be able to find those pretty easily.
After you create a new application, you set up the Tab information for it under "Facebook Integration."
The way tabs work is they create an iFrame in the Facebook canvas that loads a page from your webserver. You can do whatever you want within that iframe to make a dynamic page. Also, since it's an iframe, you can have links that go all over the place and build a whole mini-site which works inside the Facebook canvas.
Basically, you do the same thing you would normally do to create a dynamic page/site, and set up a Facebook application that points to it. There are a few caveats to building Facebook applications, but they're hard to enumerate without specific scenarios. The biggest one (and it's well documented) is that the size of a tab is 520px wide, so whatever you build has to fit within that width. The length can be whatever you want, Facebook has APIs in place that let you automatically resize the iframe as needed.
Good luck, and welcome to Facebook programming. Prepare to rip your hair out, because everything changes every 4-6 weeks :x

How to take a screenshot of a website

I am building a web browser for iPhone in Xcode and the "home page" of my app is a speed dial page which provide 6 slots for users to add their favorite website. Each slot will then display a screenshot of the website. So what I want to do here is to grab the screenshot from the link input by users, for example, "http://www.google.com". Is it possible to do this with cocoa touch?
In case anyone want to have a similar function like this, I did find a way to do it but not sure whether it's the best way of doing it. Or maybe now there are libraries or plugins out there that provide this function already.
My solution
After users have entered a website url, you need to create a temporary UIWebView and load the url (do not make it visible to the users). After the UIWebView finished loading, you make the UIWebView visible and then take a screenshot, after that, make the UIWebView invisible again immediately (or simply destroy it). In this case, you will get the screenshot of that website and users won't notice what just happened.

titanium webview - go to default browser when clicking links

in titanium, i'm using the webview to display a wordpress blog page, that is already formatted for mobile browser. instead of writing my own interface, this works as a good work around. the apps sole focus isn't the browser.
but my issue lies, when the user clicks a link outside of the initial displayed domain. i only want the main domain to be displayed in the apps browser. if any other link is clicked, that takes the user outside of that domain, i want to have it open in the phones default browser.
can anyone point me in a direction for this. i tried adding a listener to try and catch link clicks, however, i've been unsuccessful.
thanks
in this blog posting I show how to find links in a webpage and change the link behavior. Using the same method, you can intercept the links and redirect to opening the URL in the devices default browser
One solution would be to catch the onclick() Event by Javascript inside the WebView (your blog code) and handle this by a custom handler. Maybe you can inject the javascript event handler code into the running WebView through Titanium.
Another solution is to make your blogposts readable for app technology and create a new data interface. This is the way I would do. For that I would use some kind of JSON data format and a simple REST Interface to get the data.
I don't think bove solutions are that simple. If you want an app with "great feeling", you'll have to handle the events by your own. Maybe Phonegap would be a better solution four your problem. But there you will still need a kind of REST/JSON interface for your blog data. The idea behind an app is, that the main code is in your app and you get the content from a remote source. This way you'll get an advantage compared to a simple browser optimized site.

Link directly to Google Maps transit directions mobile site

If you visit maps.google.com on a mobile device, then press 'Menu', 'Get Directions', and select the 'transit' option, you are taken to a page where you can enter two locations and a date/time, and get directions on public transit. However, the URL is still maps.google.com.
Is there any way to link directly to this page so that I can load it in a UIWebView in my iOS app? Would 'clicking' the buttons in Javascript be (the only/a good) solution?
Try: http://www.google.com/transit
Even clicking the buttons in javascript doesn't seem to be working. The Google Maps code is a little strange- the event listeners aren't assigned directly and I can't get a .click() to work. So what I'll do is have the user enter the two locations in boxes in the app, then load something like http://maps.google.com/maps?f=d&source=s_d&saddr=Coover+Hall&daddr=lied+rec+center in the UIWebView, except I'll add some more specific location information before building the URL, since this is a city-specific app. Not a perfect solution but it gets the job done.
You could create a URL that links to the transit directions with the "dirflg=r" paramater.
Find the other URL parameters here: http://web.archive.org/web/20110714031648/http://mapki.com/wiki/Google_Map_Parameters