CSDN Forum RSS reading, (beginners learn collection, original), thank you for your advice

Source: Internet
Author: User
Tags preg
CSDN Forum RSS reading, (beginners learn collection, original), thank you for your advice. This is the case: The CSDN Forum does not have a mobile phone version or a tablet version. There are several other good guys who have independently designed the installation version of an addroid system, which also has its own disadvantages: be sure to install (memory occupied) and you cannot customize your favorite forum. I read the RSS on the CSDN Forum (for beginners to learn about collection and originality). thank you for your advice.
This is the case: The CSDN Forum does not have a mobile phone version or a tablet version. There are several other good guys who have independently designed the installation version of an addroid system, which also has its own disadvantages: be sure to install (memory occupied) and you cannot customize your favorite forum.

I personally like to watch things on the bus and visit the csdn Forum in bed at night. there is no way to learn. What if I directly open www.csdn.net my traffic? It takes a long time to load the wrong version, all of which are advertisements and images. Today, I wrote a program that can read csdn rss. to learn about collection and xml, I want to share it with other Chinese people. As follows:

Program Name: csdn Forum reading (for mobile phones and tablets)

Demo address: http://www.ruci.org/rss.php

Principle: php reads csdn rss and collects speeches from users on the forum.

Features: suitable for accessing forums on mobile phones, tablets, and pda mobile terminals, with no unnecessary images or advertisements. you can customize your favorite forum, with fast loading speed and low traffic, installation-free features.
Please give me some advice. what's wrong? thank you.
Rss. php
PHP code
  CSDN Forum RSS readingCSDN Forum RSS reading for tablets
  
  
  • Moderator recommendation-technical zone
  • Moderator recommendation-living area

  • Web development
  • PHP
  • Web development HTML (CSS)
  • Web development JavaScript
  • Develop MySQL/Postgresql for other databases

  • Linux/Unix community

Show. php
PHP code
  Csdn online browser

Return

Load ($ rss_link); // read the xml file $ rss_root = $ dom-> documentElement; // get the root of the xml data $ items = $ rss_root-> getElementsByTagName ("item"); // obtain all the item nodes foreach ($ items as $ it) {// read the first item node $ children = $ it-> childNodes; // Obtain all nodes of $ it; $ row_array = array (); // initialize the array foreach ($ children as $ key => $ e) // process each item {if (strcmp ($ e-> nodeName, "title ") = 0) // obtain the title and link of each item {$ row_array [$ e-> nodeName] = "*". $ e-> nodeValue;} if (strcmp ($ e-> nodeName, "link") = 0 )) {$ row_array [$ e-> nodeName] = "nodeValue. "'> Read" ;}}$ row = implode ("=>", $ row_array); // Save the Read data to the string $ row. ="
"; Echo $ row ;}?>

ShowContent. php
PHP code
  Untitled Document

Return

# IUs '; $ preg2 =' # \ (this, 111 \); \ '> (. *) <\/a> <\/dfn> <\/li> # U'; preg_match_all ($ preg, $ con, $ arr); preg_match_all ($ preg2, $ con, $ arr2); for ($ I = 0; $ I ';} Else {echo "th ". $ I. "floor ". $ arr2 [1] [$ I]. ":". $ arr [1] [$ I].'
';}}?>

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.