Categories: Tips & Tricks

Use WordPress to print a RSS feed for Eventbrite attendees

Today I was working on the WordCamp.LA site. I was trying to show the “attendee list” on the attendees page with out having to update the page every day.

Since I am using EventBrite to promote and sell ticket to the event I can collect info from there list. Evey one who purchases a ticket gets put into the ticketed database which you can view with either RSS or OPML.

I chose to use RSS and the WordPress core file rss.php.

In the functions.php file I’ve added this function:

function attendee_feed_print_2009() {
 global $wpdb;
  include_once( ABSPATH . WPINC . '/rss.php' );
  $rss = fetch_rss( 'http://www.eventbrite.com/rss/event_list_attendees/384870157' );
  $items = array_slice( $rss->items, 0 );

Where I’ve named my function, and included the core RSS file from WordPress. I also told it to fetch the feed from the address (alternatively you can use any feed link you like).

if ( empty( $items ) ) echo '<ul style="list-style-type: none; list-style-image: none; list-style-position: outside;"><li>No items</li></ul>';

 else

 foreach ( $items as $item ) : ?>
 <ul style="list-style-type:none; list-style-image:none; list-style-position:outside; margin-bottom: 0px">
 <li><!--<strong><?php echo $item[ 'title' ]; //User name ?></strong><br />-->

 <?php echo $item[ 'content' ][ 'encoded' ]; ?>

 <hr style="border: 1px solid #ddd; margin-bottom: 8px" />
 </li>
 </ul>
 <?php endforeach;

I then added the core style to fit this current feed.

And the final out come looks like this:

function attendee_feed_print_2009() {
 global $wpdb;
 include_once( ABSPATH . WPINC . '/rss.php' );
 $rss = fetch_rss( 'http://www.eventbrite.com/rss/event_list_attendees/384870157' );
 $items = array_slice( $rss->items, 0 );
 if ( empty( $items ) ) echo '<ul style="list-style-type: none; list-style-image: none; list-style-position: outside;"><li>No items</li></ul>';

 else

 foreach ( $items as $item ) : ?>
 <ul style="list-style-type:none; list-style-image:none; list-style-position:outside; margin-bottom: 0px">
 <li><!--<strong><?php echo $item[ 'title' ]; //User name ?></strong><br />-->

 <?php echo $item[ 'content' ][ 'encoded' ]; ?>

 <hr style="border: 1px solid #ddd; margin-bottom: 8px" />
 </li>
 </ul>
 <?php endforeach;
}

Don’t forget to wrap the code in <?php ?>

I want to thank John Kolbert for helping me with printing the content:encoded portion. http://pastebin.com/m1588fb30

See it in action: http://wordcamp.la/attendees/

Web Master

Hi, I am Miguel, I bought this site in 2009. So I now run or manage the site. Please visit my new website or follow me on twitter @W3i.

Recent Posts

Essentials for Ecommerce Website Development

While e-commerce is projected to account for more than $6.5 trillion in sales by 2023,…

1 hour ago

17 Essential Link Building Statistics and Trends for Enhanced SEO

The analysis highlights the significance of link-building in SEO, revealing that most websites neglect backlinks,…

13 hours ago

Get a copy of the book Blog Blazers!

Hey everyone, I've got two copies of Blog Blazers that I want to give away…

1 day ago

101 of the best blogging tools in 2024,

101 of the best blogging tools in 2024. Having the best blogging tools continues to…

2 days ago

Remove the title attribute using jQuery

In WordPress, when you use wp_page_menu your anchor attribute's usually carry a title with the…

2 days ago

In case you missed it, ma.tt is all new!

You should head over the the newly redesigned site of Matt Mullenweg, the inventor of…

3 days ago