PHP and AJAX create advanced RSS aggregators

Source: Internet
Author: User
RSS aggregators are especially suitable for applications built using standard AJAX engines. However, it is difficult to implement cross-origin AJAX requests for RSS Feedback. In this article, I will show you how to use a simple PHP function to implement quot ;...

RSS aggregators are especially suitable for applications built using standard AJAX engines. However, it is difficult to implement cross-origin AJAX requests for RSS Feedback. In this article, I will show you how to use a simple PHP function to implement the "bridge" AJAX engine and RSS content.
I. INTRODUCTION

Now, developing an RSS aggregator is no longer difficult, but developing a high-quality RSS aggregator is still quite difficult. On the other hand, it is generally not difficult to create a custom aggregator, and you can provide an interface of your choice in this aggregator. RSS aggregation represents a type of data that is especially suitable for consumption by an AJAX application because it is in XML format and AJAX can display new feedback well without page refreshing. However, the problem always exists: it is impossible to implement cross-origin AJAX requests in a standard AJAX engine. In this article, I will show you how to use a simple PHP function to bridge AJAX engines and remote content (in this article it refers to RSS feedback ).

Tip: This article assumes that you have a basic understanding of PHP and have experience in using AJAX and XML analysis. To fully understand the examples provided in this article, you need to download the corresponding source code file.

II. start

Before we officially start, I would like to briefly introduce the AJAX engine we will use to send requests. The engine simplifies AJAX calls and helps eliminate a large number of redundancy when requests are sent and scheduled. I will not discuss its composition code in detail, but will just give you a brief introduction to how we use it in this article.

First, we need to import all the javascript files that constitute the engine. The code included in our index.html file looks as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.