Search the Community
Showing results for tags 'rss'.
-
I have a rss.php for my web site which fetch all articles from all catalog and works fine BUT NOW I want NOT all articles from all catalog I want only catalog " my_catalog_1" I want fetch all articles from " catalog 1 " here is my rss.php now (which work fine fetch all articles) ======================= <?php include('connect.php'); $sql = "SELECT * FROM carbon_topics ORDER BY id DESC LIMIT 20"; $query = mysql_query($sql) or die(mysql_error()); header("Content-type: text/xml"); echo "<?xml version='1.0' encoding='UTF-8'?> <rss version='2.0'> <channel> <title>9lessons | Programming Blog </title> <link>http://example.com</link> <description>Programming Blog </description> <language>en-us</language>"; while($row = mysql_fetch_array($query)) { $Topic=$row['Topic']; $ID=$row['ID']; echo "<item> <title>$Topic</title> <link>http://example.com/t/$ID</link> </item>"; } echo "</channel></rss>"; ?> ===================== here is my database (this database name is forum_catalog) this is the catalog it contains :" news , questions, help " and now I want only fetch articles from table(forum_catalog) =>news how to done that?
-
I tried to solve problem, but without success, so I am here to seek for some help. I have folder on web server, that contains subfolders and pdf files. I need PHP script that monitors folder and subfolders and create XML for RSS feed on site homepage whe new files are added to folders. Site is on local network only, it is not accesible via Internet. I tried number of scripts but without success. Any advice please?
-
Hi, I want to use an external rss in my site but the problem is that i only want to grab feeds that contain certain keywords in the title, This is what i got so far to display the feed: <?php $html = ""; $url = "http://www.feedsite.com/conv-rss.asp"; $xml = simplexml_load_file($url); for($i = 0; $i < 5; $i++){ $title = $xml->channel->item[$i]->title; $link = $xml->channel->item[$i]->link; $description = $xml->channel->item[$i]->description; $pubDate = $xml->channel->item[$i]->pubDate; $html .= "<a href='$link'><h3>$title</h3></a>"; $html .= "$description"; $html .= "<br />$pubDate<hr />"; } echo $html; ?> The feed is a classified jobs but i only need the jobs listed for musicians, keywords could be: bassist, singer, drummer, musician, etc.. Thanks
-
I'm currently running a classified ads site and planning to display my own content from database combined with and external site rss. So here is what i got right now after the db query for the jobs ads (procedural php), while ($row = mysqli_fetch_array($results, MYSQLI_ASSOC)){ echo '<div class="media margin-none"> <a class="pull-left bg-inverse innerAll text-center" href="#"><img src="'.$foto.'" share_alt="" width="100" height="100"></a> <div class="media-body innerAll"> <h4 class="media-heading innerT"> <a href="' . $row['title'] .'-da' . $row['id_ad'] . '" class="text-inverse">'. $remuneracion .' ' . substr(ucfirst(strtolower($row['title'])), 0, 53) . '</a> <small class="pull-right label label-default"><i class="fa fa-fw fa-calendar-o"></i> ' . $row['date_created'] . '</small></h4> <p>' . substr(ucfirst(strtolower($row['description'])), 0, 80) . ' ...</p>'; echo '</div> </div> <div class="col-separator-h"></div>'; } echo pagination($statement,$per_page,$page, $url_filtros, $filtros); ?> it is the while loop that i use to display ads from my database, what could be the best way to display (in this same loop?) other site's rss feed so i can show my content combined with the external rss? Thanks
-
I have jobs portal where registered users posts new jobs searches This weekly newsletter will send all the jobs posted in the site (in a week) to the registered users but in a more personalized way: For example, posted jobs looking for designers should be sent to users registered as designers. what is the best way to do this? any recommendations? Thanks in advance.
-
I want to edit an xml using PHP and POST from iOS app. The XML Looks like: <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> <channel> <atom:link rel="self" type="application/rss+xml" href="http://www.316apps.site90.net/Test.xml"/> <lastBuildDate>Mon, 3 Feb 2014 09:26:14 -0500</lastBuildDate> <title>Prayer Warrior</title> <description><![CDATA[Prayer Warrior]]></description> <link>http://www.316apps.site90.net</link> <language>en</language> <copyright>2014 Prayer Warrior</copyright> <item> <first_name>John</first_name> <last_name>Doe</last_name> <title>I need money</title> <date>Mon, 3 Feb 2014 09:26:14 -0500</date> <anonymous>No</anonymous> <prayer_warriors>1</prayer_warriors> <location>USA</location> </item> <item> <first_name>Jane</first_name> <last_name>Doe</last_name> <title>I need money</title> <date>Tue, 4 Feb 2014 09:26:14 -0500</date> <anonymous>No</anonymous> <prayer_warriors>1</prayer_warriors> <location>USA</location> </item> </channel> </rss> Over time, the XML will grow. In my iOS app I have a UITableView that parses the XML into different rows. When they view a row, I want it to increase the count on the prayer. PHP I am using now is: <?php $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $title = $_POST['title']; $xml = simplexml_load_file("http://www.316apps.site90.net/Test.xml") or die("Not loaded!\n"); $responses = $xml->xpath("//channel/item[title = $title and first_name = $first_name and last_name = $last_name]/prayer_warriors"); $responses[0][0] = $responses[0] + 1; print_r($responses); $xml->asXML("Test.xml"); ?> The iOS app uses this code for POST to it: RSSEntry *entry = [_allEntries objectAtIndex:indexPath.row]; NSString *myRequestString = [NSString stringWithFormat:@"first_name=%@&last_name=%@&title=%@", entry.firstName, entry.lastName, entry.prayerRequest]; // Create Data from request NSData *myRequestData = [NSData dataWithBytes: [myRequestString UTF8String] length: [myRequestString length]]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString: @"http://www.316apps.site90.net/Increase.php"]]; // set Request Type [request setHTTPMethod: @"POST"]; // Set content-type [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"]; // Set Request Body [request setHTTPBody: myRequestData]; // Now send a request and get Response NSData *returnData = [NSURLConnection sendSynchronousRequest: request returningResponse: nil error: nil]; // Log Response NSString *response = [[NSString alloc] initWithBytes:[returnData bytes] length:[returnData length] encoding:NSUTF8StringEncoding]; NSLog(@"Response%@",response); However, nothing changes, and I get an invalid predicate message on the response on my iPhone for the line: $responses = $xml->xpath("//channel/item[title = $title and first_name = $first_name and last_name = $last_name]/prayer_warriors"); Thoughts?
-
So a little background I have to create a RSS feed for a crawl for a monitor wall above out studios news desk that only accepts the description field so I have made a page that takes another RSS feed and only displays the description field and adds some spaces then a pipe with a few more spaces and makes it all CAPS Making it look like this CRAWL ITEM 01 | CRAWL ITEM 02 | CRAWL ITEM 03 | The problem is I need the get rid of the ending pipe Making it look like this CRAWL ITEM 01 | CRAWL ITEM 02 | CRAWL ITEM 03 This is what I have so far If anyone can show me how to get rid of the ending pipe would be great. I have read about the implode function but don’t know how to implement it I and very novice with php, most of the code I got off another forum And yes a lot of things are commented out incase I need then in the future Thx <?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"> <channel> <?php $rss = new DOMDocument(); $rss->load('http://site.com/temp/rss_clean_feed/sample.rss'); $feed = array(); foreach ($rss->getElementsByTagName('item') as $node) { $item = array ( 'title' => $node->getElementsByTagName('title')->item(0)->nodeValue, 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue, 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue, 'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue, ); array_push($feed, $item); } $limit = 8; for($x=0;$x<$limit;$x++) { $title = str_replace(' & ', ' & ', $feed[$x]['title']); #$link = $feed[$x]['link']; $description = $feed[$x]['desc']; $description = strtoupper($description); #$date = date('l F d, Y', strtotime($feed[$x]['date'])); echo '<item>' . "\n"; #echo '<title>'.$title.'</title>'; echo '<description>'.$description.' | '; echo '</description>' . "\n"; echo '</item>' . "\n"; } ?> </channel> </rss>
-
I have a bunch of rss feeds written in php that I host on my home server that display as sports ticker information on my mobile phone. Basically, scripts parse the url string for each sport in espn's bottom line app. I'm stuck on one sport in particular, though... Golf. Here's the url that I am trying to parse into RSS feed for golf scores: http://sports.espn.go.com/sports/golf/bottomLineGolfLeaderboard Basically, all I want to do is have each players score as the title of an RSS news item. I'm using it with an ajax feed scroller on my mobile phone so it essentially operates as a sports score ticker. As such, when the ajax feed scroller reads my golf script, it should scroll each of the following in order (based on the url above): RBC Canadian Open Leaderboard Final Round Complete 1. Brandt Snedeker (-16) F 2. William McGirt (-13) F ........ Regarding what I've been working with, I tried working on a few more things, and it looks like I am getting a little closer. The code now at least appears to be counting/seeing each score item, but unfortunately it's not populating the score itself as an rss item. Here's the code I'm working with: <? // begin rss feed header("Content-Type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n"; echo "<rss version=\"2.0\">\n\n"; echo "<channel>\n"; $results = array(); // Get page $page = file_get_contents("http://sports.espn.go.com/sports/golf/bottomLineGolfLeaderboard"); // grab all variables out of the page preg_match_all("/&([^=]+)=([^&]+)/", $page, $matches); //loop through all the variables on the page foreach ($matches[1] as $match) { // get score preg_match("/s_right\d+_\d+/", $match, $temp); $results = $temp['2']; echo "<item>"; echo "<title>". $results ."</title>"; echo "</item>"; } echo "</channel>"; echo "</rss>" ?> Which gives me this output: <?xml version="1.0" encoding="ISO-8859-1"?> <rss version="2.0"> <channel> <item><title></title></item><item><title></title> </item><item><title></title></item><item><title></title> </item><item><title></title></item><item><title></title> </item><item><title></title></item><item><title></title> </item><item><title></title></item><item><title></title> </item><item><title></title></item><item><title></title> </item><item><title></title></item><item><title></title> </item><item><title></title></item><item><title></title> </item><item><title></title></item><item><title></title> </item><item><title></title></item><item><title></title> </item><item><title></title></item><item><title></title> </item><item><title></title></item><item><title></title> </item><item><title></title></item><item><title></title> </item><item><title></title></item><item><title></title> </item><item><title></title></item> </channel></rss> I just don't get where I am going wrong. Am I missing something that is causing the output data for the array not to be produced as titles? I've tried tinkering with everything I can think of based on my limited knowledge. Can anyone provide some insight?
-
Hi, I am building an RSS Aggregator plugin for my Wordpress Installation. One of the feeds I am using is: https://news.google.co.uk/news/feeds?pz=1&cf=all&ned=uk&hl=en&cf=all&as_qdr=w&output=rss&q As you can see this feeds content is a table of data including news headline, excerpt and a tiny thumbnail image. How is it possible for me to extract the actual full article text and the large Image from the <link> tag of the RSS item or does it look like I have the wrong news feed? Thanks for advice with this.
-
Browser result is different than php curl output. How to fix it? http://kat.ph/applications/?rss=1 $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://kat.ph/applications/?rss=1"); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/rss+xml; charset=ISO-8859-1", "Content-length: ")); $result = curl_exec($ch); curl_close($ch); echo $result;
-
- match result
- rss
-
(and 1 more)
Tagged with:
-
Hi, I am trying to read the atom atom rss standard with the following code, but I do not manage to read the LINK & CONTENT. Could you please help me ? I have posted my php code here and I also attached a sample of the XML code i am reading with its source link under here. Thank in advance for your help. <?php function getFeed($feed_url) { $content = file_get_contents($feed_url); $x = new SimpleXmlElement($content); echo "<ul>"; foreach($x->entry as $entry) { //WORKS echo $entry->title; echo $entry->author->name; //DOESNT WORK echo $entry->content; echo $entry->link; } echo "</ul>"; } ?> A sample of RSS code I am reading : <?xml version="1.0" encoding="ISO-8859-1"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title>FINN jobb - Alle stillinger</title> <link rel="alternate" href="http://www.finn.no/finn/job/fulltime/result/" title="FINN jobb - Alle stillinger" /> <rights>Copyright 2010</rights> <logo>http://cache.finn.no/img/logofinn.gif</logo> <entry> <title>Lyst å jobbe med IT support?</title> <link rel="alternate" href="http://www.finn.no/finn/object?finnkode=38539103" title="Annonse" /> <author> <name>People4you It Bemanning AS</name> </author> <published>2012-11-24T00:07:00Z</published> <content type="html"><div><div style='float:left;'>Sted: Oslo<br/>Firma: IT People4you<br/>Tittel: Support / brukerstøtte<br/>Kategori: IT / Telekommunikasjon / Internett, IT / Telekommunikasjon / Internett<br/></div></div></content> </entry> Source