How do I display clickable wordpress blog post titles in an UITableView for iOS? - ios

I am working on a iOS application in which I would like users to be able to access a table view list of blog post titles. The blog is self-hosted and runs on the Wordpress platform. The blog is linked to a twitter account so that each time a new post goes live, a new tweet is generated with the post title and the url. I was thinking that I could retrieve the twitter feed and insert the tweets into my table but I don't know if that's the easiest/best way to do it. Does anyone have any ideas?

You might want to setup an RSS to UITableView instead of bringing in the twitter API to do the job for you. If you keep the UITableView dependent on the Twitter API, you are inducing an additional, unwanted level of data dependency. Use RSS and update the UITableViews. You could possibly use this: http://dblog.com.au/iphone-development/rss-reader-part-4-setting-up-the-uitabbar-and-uitableview-with-delegates/ although I'm not sure if this is what you are looking for.

Related

How to intergrate a single tweet into your website

Right now im building a simple html/css site for a friend. The homepage is a series of grid block divs that hold some content.
There are currently 3 block divs we have marked for social media posts. So for example, he wants his latest tweet to appear in one of those divs. His latest instagram post to appear in another and facebook in the last.
We can ignore facebook for the time being as I'm only focusing on the twitter/instagram for now.
I'm struggling with where to begin for this project. In the past I have only embedded twitter timelines, Instagram posts using widgets etc....nothing too complicated.
But for this project I will need separate stripped down posts, ie: just the plain text from his tweet inside the twitter div. The image from his Instagram post as the background image on the Instagram block etc...
I've spent the last few hours trying to get my head around oEmbed, and I can safely say I'm failing miserably.
I'm actually more confused now then before I started, so if any kind soul could give me a dummies guide to how I can approach this, that would be absolutely amazing.
Thank you!
You can acheive a single embedded tweet using an embedded timeline.
To get just one tweet, use the data-tweet-limit attribute on the embed tag, as detailed here:
https://dev.twitter.com/web/embedded-timelines/parameters
For example:
<a class="twitter-timeline" href="https://twitter.com/TwitterDev" data-widget-id="some_id" data-tweet-limit="1"></a>
According to twitter's documentation, that is the recommended way of getting tweets onto websites. From your description of the use case, I'd highly recommend just using Twitter's official widget.
If you really want to use Twitter's REST API and generate your page server side, I'd check out this stack overflow question as a starting point:
Setting up Twitter API, getting the last few Tweets
Hope that helps!

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 to get twitter feeds in shopify

I am trying to get twitter feeds in to my shopify site. I want to get the feeds and style them as I want and thus cant use a app.
I know how to do it using PHP but can not use that code in shopify and looking for a way I can use OAuth in shopify and get the feeds. I tried the shopify docs but without an example its kinda hard to actually get my head around it.
http://docs.shopify.com/api/tutorials/oauth
Thats the link I am using as a guide. If anyone can direct me to an example which might be similar that would be awesome. (google didnt seem to be that helpful this time either)
Cheers
I know you said you didn't want to use an app, but can I suggest taking a look at Twitify? You can use custom CSS to style your tweets. Also see discussions about Twitify here and here.
Twitter changed their display guidelines and policies on embedding of tweets on websites in June 2013. One of the themes I used for a client earlier in the year had custom styling of tweets, and they have now changed it to use the official Twitter widget to meet the new guidelines. In fact, the images on the Shopify theme store show how it used to look before Twitter changed things:
And after:
I think using an app like Twitify would be the easiest way to deal with these changes to embedding tweets.
Thanx for the suggestion. I did take a look at that before I posted this question. This is a project for a client and I dont think getting a plug in is a viable option. Anyways I found a work around.
Hosted the file on a server and then accessed it. So that resolved the problem. :)
I used node.js to write the script and get the posts as required.
Cheers.
you can use the app for that Twitify https://apps.shopify.com/twitify or you can Embed a Twitter feed in your online store
Go to your Twitter settings.
Click Widgets to open the widgets menu.
Create a new widget, following Twitter's instructions.
Copy the embed code.

Displaying tweets from multiple users (similar to Embedded Timelines) without twitter-side user lists

I am new to Twitter and need some tips.
I need to display tweet feed from multiple users on some webpage.
The first thing I stumbled upon is Embedded Timelines. It allows to display tweets from list of users but the gotcha is that those lists should be maintained on Twitter-side (i.e. I cannot specify #qwe and #asd only on my side and get timeline without adding those users into list on Twitter-side).
The thing is that list of users that should be included into timeline is dynamic and managing those lists through Twitter API will probably be painful. Not to mention that my website will probably generate tons of those lists and I feel that I will violate some api quotas sooner or later.
So, my question is - am I stuck with using Embedded Timelines that refer some user list on Twitter-side and managing those lists through, say Twitter REST api, or there is a simplier way to do what I want?
It's pretty simple to display tweets for multiple users.
Links to start with
This post explains some of the search queries you can make
This post is a simple library to make requests to the twitter API that 'just works'
Your Query
Okay, so you want multiple users. The endpoint you're looking at using is the search/tweets one: https://api.twitter.com/1.1/search/tweets.json.
The query string uses :from and you can interpolate multiple froms with AND/OR.
An example query for the GET request:
?q=from:user1+OR+from:user2
Read more about the search API queries here.
Your "over-the-quote" issue
This is something you're going to need to figure out yourself - depending on the number of requests you expect to make, and the twitter imposed limits, maybe some sort of caching or saving information when you hit your limit, and only pull back from the cache whilst you're hitting your limit..

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 :)

Resources