You might also want to sort the feeds based on the date instead of based on the source. Taking this example as a starting point, it is very easy to show extra information from the feed items e.g. Of course, this is a very simple example but enough to fulfil my requirements. As you can see, it only takes a single line of code to interact with the Google Feed service. The result is an object that let’s us interact with REST services in a very simple manner. We will also need to download a copy of the jGFeed source. Inside this directory create another one called assets. I have created a directory in my Desktop called 'feedreader'. All the feeds are then placed in an array which is returned to the calling method.įeedLoader is created with an AngularJS $resource factory. Step 1: Organising the Files for the Tutorial Before we start writing any code let's create a directory where to place the feed reader files. For each URL it calls FeedLoader.fetch() to retrieve the actual feeds. The FeedList service contains one method – get() – that holds an array of feed URLs. I want request to load view as well as make json data availabel for sam loaded view in bellow ajax request, I am making request to dataDetail method which load views and also i want json data to be available in same loaded views, I tried following code bot its not working. It also registers itself as as a listener on the FeedList in case the data has changed. The Google Ajax Feed API generates a result document, whose structure is different from either an RSS 2.0 or the Atom 1. 55 minutes ago &0183 &32 Load vie in ajax request CI3. The controller FeedCtrl places the feeds retrieved from the get() method of the FeedList service on the $scope. So what I ended up with is a very basic HTML page sprinkled with a few AngularJS directives: With Google’s Feed API, you can download any public Atom, RSS, or Media RSS feed using only JavaScript, and in the format of yout chosing – in my case JSONP. I got ready to develop some JavaScript code to download RSS feeds but then I learned about the Google Feed API, saving me alot of time. You can check out examples of what I intended to do: RSS Reader. The basic idea was to develop a page where feeds from several sources are shown so you won’t have to visit each page individually to check out the latest news. Although a new version was quickly installed, I found the broken pages to be the perfect motivation to finally do some coding with AngularJS.So after having attended a few workshops about AngularJS, and having read the excellent book by Brad Green and Shyam Seshadri, I finally got around to do some actual work with the framework. SimplePie is a nice PHP library but the version I used broke when my hosting provider decided to upgrade the servers to a new PHP version. Last year I’ve written a few lines about aggregating feeds with SimplePlie.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |