/* Plugin Name: RSS Validator Plugin URI: http://andrewnorcross.com/plugins/ Description: Checks your RSS feed against the W3 RSS validator for errors Version: 1.1 Author: Andrew Norcross Author URI: http://andrewnorcross.com Copyright 2012 Andrew Norcross This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ // http://feed2.w3.org/docs/soap.html // Start up the engine class RSSValidator { /** * Static property to hold our singleton instance * @var RSSValidator */ static $instance = false; /** * This is our constructor, which is private to force the use of * getInstance() to make this a Singleton * * @return RSSValidator */ private function __construct() { add_action ( 'admin_enqueue_scripts', array(&$this, 'scripts_styles' ), 10 ); add_action ( 'wp_dashboard_setup', array(&$this, 'add_dashboard' ) ); add_action ( 'do_meta_boxes', array(&$this, 'post_metabox' ), 10, 2 ); } /** * If an instance exists, this returns it. If not, it creates one and * retuns it. * * @return RSSValidator */ public static function getInstance() { if ( !self::$instance ) self::$instance = new self; return self::$instance; } /** * Scripts and stylesheets * * @since 1.0 */ public function scripts_styles($hook) { // for post editor if ( $hook == 'post-new.php' || $hook == 'post.php' ) : wp_enqueue_style( 'validator-style', plugins_url('/lib/css/rss-validator.css', __FILE__), array(), null, 'all' ); wp_enqueue_script( 'validator-init', plugins_url('/lib/js/validator.init.js', __FILE__) , array('jquery'), null, true ); endif; // for dashboard $current_screen = get_current_screen(); if ( 'dashboard' == $current_screen->base ) : wp_enqueue_style( 'validator-style', plugins_url('/lib/css/rss-validator.css', __FILE__), array(), null, 'all' ); wp_enqueue_script( 'validator-init', plugins_url('/lib/js/validator.init.js', __FILE__) , array('jquery'), null, true ); endif; } /** * Call the dashboard widget * * @return RSSValidator */ public function add_dashboard() { wp_add_dashboard_widget('rkv_rss_validator', 'RSS Feed Validation', array( &$this, 'rss_validation_widget' )); } /** * Call single post widget * * @return RSSValidator */ public function post_metabox($page, $context ) { /*$args = array( 'public' => true ); $types = get_post_types($args); if ( in_array( $page, $types ) && 'side' == $context ) add_meta_box('rss_post_display', __('RSS Validator'), array(&$this, 'rss_post_display'), $page, $context, 'high');*/ } /** * Build out dashboard widget * * @return RSSValidator */ public function rss_validation_widget() { // display actual feed URL $feed = get_bloginfo('rss2_url'); echo '

Your main RSS feed: '.$feed.'

'; // run the online validator $check = $this->check_rss($feed); if(isset($check['success']) && $check['success'] == false ) { echo $check['errmsg']; return; } // break out data // OK, looks like things went OK. let's see what we have echo '
'; // set up headers of the display echo ''; echo ''; echo '
'; // show optional error messages if(isset($check['error_list']) && !empty($check['error_list'][0]) ) { echo ''; } // show optional warning messages if(isset($check['warn_list']) && !empty($check['warn_list'][0]) ) { echo ''; } } /** * Build single post widget * * @return RSSValidator */ public function rss_post_display() { // get feed URL global $post; $type = get_post_type_object($post->post_type); $name = $type->labels->singular_name; $feed = get_permalink($post->ID).'feed/'; echo '

This '.$name.' RSS feed
'.$feed.'

'; // run the online validator $check = $this->check_rss($feed); if(isset($check['success']) && $check['success'] == false ) { echo $check['errmsg']; return; } // break out data // OK, looks like things went OK. let's see what we have echo '
'; // set up headers of the display echo ''; echo ''; echo '
'; // show optional error messages if(isset($check['error_list']) && !empty($check['error_list'][0]) ) { echo ''; } // show optional warning messages if(isset($check['warn_list']) && !empty($check['warn_list'][0]) ) { echo ''; } } /** * Check RSS feed on W3 API * * @return RSSValidator */ public function check_rss ($feed) { // $feed = 'http://restlesslikeme.com/feed/'; $request = new WP_Http; $url = 'http://validator.w3.org/feed/check.cgi?url='.urlencode($feed).'&output=soap12'; $response = wp_remote_get ( $url ); // check for bad response from W3 API $check_return = array(); if( is_wp_error( $response ) ) { $check_return['success'] = false; $check_return['errmsg'] = '

Sorry, there was an error with your request.

'; } if(!is_wp_error( $response ) ) { $feed_data = $response['body']; $return_xml = simplexml_load_string( (string) $feed_data ); $return_xml->registerXPathNamespace( 'm', 'http://www.w3.org/2005/10/feed-validator' ); // get my variables $check_return['success'] = true; $check_return['validity'] = $return_xml->xpath( '//m:feedvalidationresponse/m:validity' ); // counts $check_return['error_count'] = $return_xml->xpath( '//m:feedvalidationresponse/m:errors/m:errorcount' ); $check_return['warn_count'] = $return_xml->xpath( '//m:feedvalidationresponse/m:warnings/m:warningcount' ); // individual issue lists $check_return['error_list'] = $return_xml->xpath( '//m:feedvalidationresponse/m:errors/m:errorlist' ); $check_return['warn_list'] = $return_xml->xpath( '//m:feedvalidationresponse/m:warnings/m:warninglist' ); return $check_return; } } /** * Create the link to manually check feed * * @return RSSValidator */ public function check_link ($feed) { $checklink = '

See complete details on W3 Validator site

'; return $checklink; } /// end class } // Instantiate our class $RSSValidator = RSSValidator::getInstance(); Coachella, el festival que sacude Los Ángeles - Imperdibles - Revista ASIA SUR

Coachella, el festival que sacude Los Ángeles

coachella1 Foto: Coachella

¿Le apetece bailar con Leonardo DiCaprio al ritmo de AC/DC? ¿Qué tal escuchar lo último de Lykke Li junto a Lindsay Lohan? ¿Y tomarse una cerveza con Jared Letto y Katy Perry mientras escuchan tocar a David Guetta? Si cualquiera de estas propuestas te parece genial no deberías perderte el Festival de Coachella, que se celebrará del 17 al 19 de abril en Los Ángeles, Estados Unidos.

coachella9 Foto: Famousimportants

Los orígenes del Festival de Coachella se remontan a 1993, cuando Eddie Vedder, líder de la banda de rock estadounidense Pearl Jam, decidió participar en el boicot contra la empresa Ticketmaster -a la que se acusaba de tener el monopolio de los escenarios del sur de California-, organizando un concierto en el Club de Polo Empire de Indio, California; un recinto que nunca antes había acogido un festival de música. Esa primera vez asistieron 25 mil personas.

coachella4 Foto: E!

Fue en 1999, sin embargo, cuando el evento empezó a celebrarse de manera regular, logrando año tras año aumentar el número de asistentes con unos carteles que mezclaban lo mejor del rock y la electrónica alternativa, con actuaciones de grupos como The Chemical Brothers, Underworld, Pixies, Radiohead, The Cure, Nine Inch Nails, Daft Punk o Massive Attack.

En 2001 la pequeña promotora de punk que organizaba el festival, Goldenvoice, fue adquirida por el gigante del entretenimiento Anschutz Entertainment Group y poco a poco Coachella fue creciendo hasta convertirse en lo que es hoy en día.

Así que, no te pierdas este evento, que es alucinante. Más información: https://www.coachella.com/home/

coachella7 Foto: Hawtcelebs