Advertisements
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/

Advertisements

Random Search Terms

Title

Top Articles

powered by WassUp

Recent Posts: Fully Net Worth . com

Scott Borchetta Net Worth: How Rich is the Music Executive?

Scott Borchetta Net Worth: How Rich is the Music Executive?

Scott C. Borchetta is an American record executive and entrepreneur. He is the founder of Big Machine Label Group which has four subsidiaries which are Machine Records, BMLG Records, The Valory Music Co., and Nash Icon Records. As of 2019 Scott Borchetta net worth is estimated to be $230 million. Borchetta was born on July […]

Kailyn Lowry Net Worth: How Rich is Kailyn Lowry Actually?

Kailyn Lowry Net Worth: How Rich is Kailyn Lowry Actually?

Kailyn Rae Lowry is an American reality television personality and author. She is best known for being a regular cast member of the reality television series 16 and Pregnant which she became a part of in 2010. As of 2019, Kailyn Lowry net worth is estimated to be $500,000. Lowry was born on March 14, […]

Keyshia Cole Net Worth: How Rich is Keyshia Cole Actually?

Keyshia Cole Net Worth: How Rich is Keyshia Cole Actually?

Keyshia M. Cole is an American singer, actress, producer, and television personality. She has released multiple hit albums during her career which include The Way It Is, A Different Me, and Calling All Hearts to name a few. As of 2019, Keyshia Cole net worth is estimated to be $10 million. Cole was born on […]