Archive for the ‘Random Thoughts’ Category

24
Aug

18 Months in business

Been a while without writing on this blog, wasn’t the work, neither the lack of time, was just too much distraction. I am now celebrating 18 months and some days working as independent contractor, and I must admit, what a roller coaster has been. Since i left the great adventure that was GuestCentric and my many great friends i left there, worked on so many projects and so many people, i can’t remember all now, there were great moments to remember and others no so good.

Working as independent contractor has pro’s and con’s, will try to enumerate some below.

Pro’s

Flexible schedule and working hours

As independent, there is one thing i don’t give up, i have my own schedule and working hours, and i work on the days i want, as long as i deliver what i agree with the customer, in terms of deadlines and deliverables, all good.

15
Mar

Ideas of March

I had slowed down the pace i blog, mainly because i made the decision long time ago to write more complete content on this blog and use micro blogging, mainly Twitter, for more short posts, now i realize that i was wrong and i will go back with my decision and start to post more instant content on this blog because:

  1. I like to blog
  2. I use the blog as my personal notebook
  3. Is easier to find the content on my blog than on Twitter
  4. Is easier to keep a discussion using comment system

Saying this, i really like to blog, and i will do it often! Even if i will keep using twitter and other social media networks!

This post has been inspired by Chris Shiflet Ideas Of March (#ideasofmarch) blog post.

21
Jan

Zend Framework: Modifying rss feeds using Zend_Feed

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).

Why bother and why should i want to modify a feed

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.

20
Jan

Zend Framework : Consuming feeds using Zend_Feed

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;
?>

Some comments

$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.

04
Jan

5 good habits when working with remote teams

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.

1. Overlap most of the working hours (at least 50% of your time)

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.

2. Enforce a daily meeting by chat/video (Even if it’s only 15min)

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: