Jan
Wanna be successful ? Here’s a simple advice
Just found this, and is just the perfect match for you, if you are questioning or lamming about being successful (or not).
Did it helped ?
Professional PHP developer
Just found this, and is just the perfect match for you, if you are questioning or lamming about being successful (or not).
Did it helped ?
On the previous post, i introducing the “Consuming feeds using Zend_Feed” thematic, today i will try to explain how we can change a RSS feed and return it after the changes.
We will be acting as a proxy for the RSS feed. I will parse all feed items and add a “TEST: ” string before my title and add a tracking parameter to each link “?source=feed”.
<?php $feedUrl = "http://blog.josedasilva.net/feed/"; // Lets import the feed try { $feed = Zend_Feed::import($feedUrl); } catch (Zend_Feed_Exception $e) { echo 'Exception found: '.$e->getMessage(); } // Iterating over the feed and performing changes foreach($feed as $idx=>$entry) { $entry->title = "TEST: ".(string)$entry->title; $entry->link .= "?source=feed"; } // Saving the feed and capturing the feed output $feedContent = $feed->saveXML(); echo $feedContent; ?>
The retaining code line on this quick example is:
$feed->saveXML();
This will return a rebuild version of the feed object (not the original one).
A practical approach on modifying feed entries is the shown below, adding parameters into your links so that you can analyse it afterwards. If you use feed burner, you just need to change the feed endpoint to your script path, for the modified feed, and you are ready to go.
As you can see consuming and modifying feeds using Zend_Feed is extremely simple.
Using Zend Framework Zend_Feed is extremely simple to iteract or even modify a rss feed. Let’s give a quick look into consuming feeds.
<?php $feedUrl = "http://blog.josedasilva.net/feed/"; // Lets import the feed try { $feed = Zend_Feed::import($feedUrl); } catch (Zend_Feed_Exception $e) { echo 'Exception found: '.$e->getMessage(); } // Iterating over the feed foreach($feed as $index=>$entry) { echo (string)$entry->title."\n"; echo (string)$entry->description."\n"; } // Playing around with the complete feed and outputting it. ob_start(); $feed->send(); $feedContent = ob_get_contents(); // feed content stored on this variable ob_end_clean(); echo $feedContent; ?>
$feed = Zend_Feed::import($feedUrl);
This will import the feed from a feed url and return an object of a class that extends Zend_Feed_Abstract if the importation has success and throws a Zend_Feed_Exception if it’s not.
foreach($feed as $index=>$entry)
We may iterate over a feed object using a foreach, on my example you will access each feed entry on the $entry variable.
$entry var will be a Zend_Feed_Entry_Rss or a Zend_Feed_Entry_Atom object instance, depending on the feed type you have imported. Each $entry attribute (title, description , …) will be an Zend_Feed_Element object instance, although you can simply to access the attribute value by forcing a cast into (string).
Now, this is a quick look into reading data from a RSS feed using Zend_Feed, on the next post on this series i will give a quick insights on modifying the feed and returning the result.
Being a start-up single founder is a sign that you shouldn’t misinterpret, because is a damn important one. Had struggled with the “from idea to product cycle” sometimes and one of the major, and toughest, task is to persuade someone else to embrace it together with you. If after a few tries your still in a Single Founder position maybe this could mean something important to you.
It is extremely hard for everyone to criticise a closer friend dream, so people tend to be polite, and maybe you should start to present your idea to complete strangers in order to evaluate the real power of it. you should put yourself the following question, “If i can’t convince someone else to join me, is the idea that great ?”, is a pretty simple question and will help you more than you can think.
Over the past 9 months, when i shifted to freelancer mode, i often worked as part of a remote team, and there were some lessons learned about it. I will try to share the most valuable one’s in order to keep everything running smoothly.
Even if you’re working remotely there is need for synchronisation and topic discussion so is extremely important to have all the team working on the same working schedule, at least half of the time.
People tend to label meetings as a waste of time, not every meetings are, is important to keep everyone in the same boat, so that all the team knows on which direction is heading to, so keep a small daily meeting on the schedule, if not on the beginning of the journey make it at the end. Think on SCRUM stand-up meeting points: continue reading…