More Twitter Feed Tweaks

Written: July 24, 2009

I blogged earlier about how I found this cool PHP class to read my tweets and post them on a marketing blog page. The tweets were just unformatted and didn’t have any links in them so I set about to upgrade the formatting to add links to:

Here’s what I did in PHP using the preg_replace function:
foreach($data as $tweet) {
// Replace # with link to search.twitter.com, replace @ with link to twitter account
$link = preg_replace(“_http://[a-zA-Z0-9\./]+_”,”<a href=’$0′>$0</a>”,$tweet->text);
$replace_pound = preg_replace(“/#[a-zA-Z0-9]+/”,”<a href=’http://search.twitter.com/search?q=$0′>$0</a>”,$link);
$html_pound = preg_replace(“/q=#/”,”q=%23″,$replace_pound);
$replace_at = preg_replace(“/@[a-zA-Z0-9_]+/”,”<a href=’http://twitter.com/$0′>$0</a>”,$html_pound);
$html_at = preg_replace(“_twitter.com/@_”,”twitter.com/”,$replace_at);
print “<li>$html_at</li>
“;
}

Here’s what the linked tweet feed now looks like:

Tags:

2 Responses to “More Twitter Feed Tweaks”

  1. I love your blog.. very nice colors & theme. Did you create this website yourself or did you hire someone to do it for you? Plz reply as I’m looking to create my own blog and would like to find out where u got this from. appreciate it

  2. Daniel Payne says:

    I created this custom theme from scratch. My business is to develop custom themes, plugins and features for web sites, both WordPress and custom.

Leave a Reply

Using Twitter with Firefox

Written: July 20, 2009



I’m using Twitter for three different accounts: Portrait Photography, PMPA, Marketing EDA. My challenge was how to keep up with all those tweets from my followers, and tweeting of my own.

Twitterfox to the rescue. This ingenious Firefox browser plug-in is simple to install and use. Shown above is the pop-up window that appears when you click the little Twitter icon in the lower right-hand corner of your Firefox browser.

To swap Twitter accounts I just click on my account name and choose from a list. Simple, effective, free, all of the things that I love.

Tags:

Leave a Reply

Adding a Twitter Feed with PHP

Written: July 14, 2009

At my marketing web site www.marketingeda.com I wanted to add a Twitter feed using PHP and found something at twitter.slawcup.com/twitter.class.phps that does just that.

The PHP coding is very simple to use with this class:

include_once(‘classes/class.twitter.php’);

$t = new twitter;
$t->username = ‘marketingeda’;
$t->password = ‘********’;

$data = $t->userTimeline();

foreach($data as $tweet) {
print “<li>$tweet->text</li>
“;
}

Here’s the output result of this PHP script:

Tags: ,

Leave a Reply

Adding an RSS Feed with PHP

Written: July 14, 2009


I have a marketing web site at www.marketingeda.com and when I updated from PHP 4 to 5 my RSS feed reader stopped working. So I browsed for a simple replacement that worked well with PHP 5 and found something called MagpieRSS at SourceForge that worked wonderful.

Here’s the simple PHP code that I needed to insert on my page where I wanted the RSS feed to appear:

require(‘classes/rss/rss_fetch.inc’);
$rss = fetch_rss(‘http://www.chipdesignmag.com/payne/feed/’);
foreach ($rss->items as $item ) {
$title = $item[title];
$url = $item[link];
$description = $item[description];
echo “<a href=$url>$title</a></li><br>$description<br>”;
}

1
<br />

Here’s what this feed outputs on my page:

Tags: ,

Leave a Reply

Outlook 2007 Email Limitations

Written: July 11, 2009

This week I worked with a client to send out email messages with eROI and we were testing them in Outlook 2007. I discovered just how limited the HTML coverage is in Outlook 2007 and then finally found this wonderful reference for all of the limitations.

I was trying to add a table border using images, however this wasn’t supported in Outlook 2007.

We ended up going with a CSS border statement instead which was supported even though it didn’t look as cool as our images which used shading.

Tags: , , ,

Leave a Reply

Social Media for Photographers

Written: July 4, 2009

Blogger Facebook LinkedIn MySpace Plaxo RSS Twitter WordPress
I’ll be presenting to the Portland Metropolitan Photographer’s Association on Thursday, July 9th starting at 7PM. More details here.

Tags: , ,

Leave a Reply

Error 500 – Internal server error

Written: July 2, 2009

I’m getting this error message when I try and browse my portrait photography site at www.danieljpayne.com this afternoon. After some detective work I discovered that I can successfully browse my .html pages and .jpg files, just no .php files.

Of course I called up my web hosting company to report the bug and had to put up with someone trying to speak English in almost a mechanical dialect. I had to ask for her to repeat what she was talking about and my frustration only mounted.

I tried to explain that I could browse everything except .php files, however she didn’t know what PHP meant. That is not a good match for someone answering tech support calls at a web hosting company.

I’m supposed to wait 60 minutes for them to reset something. Lord, give me patience.

Tags:

3 Responses to “Error 500 – Internal server error”

  1. Tualatin Web says:

    So after an hour of waiting I'm still getting the error message. I did some Google searching to find out that a possible cause was PHP file permissions were not correct. I check the permissions and still no PHP working. Tech support on the 2nd phone call was more informed but couldn't fix anything, so it's getting escalated…

  2. Tualatin Web says:

    Tried SSH into my account and found that I can run PHP scripts OK! Yeah.

    Must mean that something is broken on their server, nothing wrong with my PHP scripts or permissions. I'm feeling slightly better now.

  3. Tualatin Web says:

    Finally, my site is back up and running. It must have been done for 4 hours or so.

Leave a Reply