Connect with us

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/

4 Comments

4 Comments

  1. Pingback: Twitted by eventbrite

  2. Pingback: Turn your RSS feed into a shortcode — WPCult

  3. Joanna

    August 26, 2009 at 10:53 pm

    Thanks for the tutorial. I’m going to try this out.

You must be logged in to post a comment Login

Random Search Terms

Title

Top Articles

Top Searches

powered by WassUp

Recent Posts: Fully Net Worth . com

1TakeJay Net Worth: How Rich is the Rapper Actually?

1TakeJay Net Worth: How Rich is the Rapper Actually?

1TakeJay is an American rapper who is from Compton, California. Some of his popular songs include “I Like Bi!tches”, “Arco”, and “I Know”. As of 2019, 1TakeJay net worth is estimated to be $300,000. His mother was a fan of the rap genre and as a result, from a very young age, Jay was exposed […]

Matt Farah Net Worth: How Rich is the Car Enthusiast Actually?

Matt Farah Net Worth: How Rich is the Car Enthusiast Actually?

Matt Farah is an American YouTube personality and businessman. He is known for reviewing famous cars on his YouTube channel. As of 2019, Matt Farah net worth is estimated to be $1.5 million. Matt was born on December 1, 1981, in New York City. He attended the University of Pennsylvania where he studied Bachelors of […]

David Bellamy Net Worth: How Rich was the English Botanist?

David Bellamy Net Worth: How Rich was the English Botanist?

David Bellamy was an English author, broadcaster, botanist, and environmental campaigner. David Bellamy net worth at the time of his death is estimated to be $5 million. Bellamy was born on January 18, 1933, in London to parents Thomas Bellamy and Winifred May Bellamy. As a child, he wanted to become a ballet dancer, but […]

%d bloggers like this: