The situation is this: CSDN forum, there is no mobile version, there is no tablet computer version; Other heroes have designed a addroid system to install the installation version, but also has its downside: be sure to install (occupy the space of memory) and can not customize their favorite section.
I personally like to see things on the bus, in the evening also like to visit the CSDN forum in bed, in order to learn there is no way. What if I open the www.csdn.net directly to my traffic? Loading time is very long and the wrong version, all ads, pictures. Today, I wrote a program that can read CSDN RSS, to learn to collect and XML, share with the heroes. As follows
Program Name: CSDN Forum Reading (mobile, Tablet PC only)
Demo Address: http://www.ruci.org/rss.php
Principle: Php reads csdn RSS, and then collects the speeches of the users in the forum.
Features: Suitable for mobile phones, tablets, PDA mobile terminal access to the forum, no extra pictures, no ads, can customize their favorite section, loading speed, less flow, free installation features.
Please expert guidance, inappropriate, thank you.
rss.php
CSDN Forum RSS ReadingCSDN Forum RSS Reading, Tablet PC-specific
- Moderator Recommendation-Technical area
- Moderator recommendation-Living area
- Web Development
- Php
- Web Development HTML (CSS)
- Web Development JavaScript
- Other database development Mysql/postgresql
- Linux/unix Community
show.php
CSDN Online BrowserReturn
Load ($rss _link);//Read the XML file $rss_root= $dom->documentelement;//get the root $items= of the XML data $rss _root-> getElementsByTagName ("item");//Get all the Item node foreach ($items as $it) {//Read the first item node $children= $it->childnodes;//Get $ all nodes of it; $row _array=array ();//Initialize array foreach ($children as $key + $e)//Process each item{if ((strcmp ($e->nodename, "title ==0))//Gets 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 a string $row.= "
"Echo $row;}?" >
showcontent.php
Untitled DocumentReturn
#iUs '; $preg 2= ' #\ (this,111\); > (. *) <\/a><\/dfn><\/li> #U ';p reg_match_all ($preg, $con, $arr); Preg_match_all ($preg 2, $con, $arr 2); for ($i =0; $i
';} Else{echo "No." $i. " Building ". $arr 2[1][$i].": ". $arr [1][$i]. '
';}}? >
Reply to discussion (solution)
Support original sharing, with SimpleXML code estimates can be less, XML processing I do not much, most of the time is the use of JSON
I'll knot this.
Bull man!
Generally subscribe to the kind of RSS, there are new messages, will be pushed to the client, this is the RSS
The address was not handled well.
That's a bull man.
Presentation Address not open
Dom operation .... I thought only JS can do DOM operation, shame AH.
Good and helpful.