21 octubre 2010

Como montar un agregador de noticias

Con toda la humildad del mundo, voy a contar aquí cómo he montado un agregador temático de noticias. Más que con el ánimo de enseñar, con el de compartir.
>> Servicios:
  He utilizado dlvr.it para gestionar los feeds, tanto entrantes como salientes. Tiene un interfaz muy fácil de manejar, es bastante fiable, es gratuito y no tiene ningún límite significativo en su funcionalidad, en definitiva, un magnífico producto.
  He utilizado tumblr.com como contenedor de los posts y, aunque no lo había usado antes, ya veis que mi blog están en blooger, me parece otro producto muy muy bueno.
  He utilizado bit.ly como acortador de URLs, que me dar estadísticas de uso casi en tiempo real, con informes de la última hora, últimas semana y últimos tres meses. Si no quieres, dlvr.it tiene su propio acortador de URLs.
>> Cómo seleccionar la fuentes:
He utilizado varios métodos, uno ha sido mirar las fuentes de otros agregadores similares, en mi caso, sigo de cerca a www.softwarelibre.net que hace un trabajo magnífico que me ayuda mucho, también chequeo memeame.net, genbeta.com y, por supuesto, news.google.es.
Tengo todos los blogs mencionados en mi RSS reader (Google reader) y las reviso unas 4 o 5 veces diarias, cuando veo una noticia que me interesa, voy al original, veo los posts anteriores y, si me encajan, añado la fuente al agregador.
También hago búsqueda dentro de tumblr y si me gusta el post, le hago reblog, pero si me gusta el blog entero, pues lo añado también.
Con news.google.es hago busqueda de los términos relevantes de este tema "software libre", "gobierno abierto", "linux", "firefox", etc.
>> Cómo agregar los feeds:
Utilizando dlvr.it, cómo he comentado antes, es sencillo revisar cada cierto tiempo cada unos de los feeds y enviarlos al blog agregador. Para indentificar fácilmente la procedencia, he puesto una etiqueta entre corchetes al final de cada post. Por ejemplo: [amedioentender] del blog amedioentender.blogspot.com.
Todos los posts quedan acumulados en el blog de tumblr que, como permite fácilmente cambiar la URL de algo asi como "misuperblog.tumblr.com" a "blog.midominio.com", pues queda bastante presentable.
   Con esto ya tendríamos el blog con las fuentes agregadas, pero, además hay que darle visibilidad y enviarlo a las redes sociales.
>> Cómo distribuir los posts
De nuevo, dlvr.it sirve como herramienta para distribuir los posts. Eso si, lo he configurado para que lea un sólo post por hora y no inundar a los seguidores de twitter o facebook con muchos post a unas horas y que no se queden aburridos a otras horas.
>> Configuración actual:
- Nuestras fuentes:
http://noticias.calendariolibre.com/fuentes
http://www.e-simon.info
http://conocimientolibre.wordpress.com
http://amedioentender.blogspot.com
http://www.somoslibres.org
http://culturalibremunicipal.blogspot.com
http://traduccionymundolibre.com
http://www.whitehouse.gov/open/blog
http://arduino.cc/blog/
http://antipastohw.blogspot.com/
http://www.downloadsquad.com/category/open-source
http://www.solar.org.ar
http://guai.internautas.org/
http://web.cenatic.es/web/
http://www.tecnologiaslibres.com/
http://www.linux-sur.org
http://www.visualiza.info
http://softlibre.barrapunto.com
http://ceslcam.com
http://www.linex.org
http://www.calendariolibre.com/elgg/pg/pages/view/368/frases-de-richard-stallman?view=rss
- Nuestras redes sociales:
Twitter: http://twitter.com/eventosabiertos
Facebook: http://www.facebook.com/pages/Calendario-Hispano-de-Eventos-Abiertos/260294840623?ref=ts
Identi.ca: http://identi.ca/eventosabiertos
Foursquare: http://foursquare.com/user/3531374
- Los resultados de noticias.calendariolibre.com:
empezamos el 10 de Octubre y hoy, día 21, estamos en torno a unos 100 clicks diarios, con twitter como primer referente, seguido de Facebook.
También vemos clicks directos desde el blog, de gente que se ha añadido el blog agregador como fuente RSS a su lector de feeds. En suma, resultados prometedores, de momento.


Pero no se nos debe olvidar que "solo" somos un agregador y que éste será tan bueno como las fuentes que agregamos.

16 octubre 2010

PHP code to get timezone from latitude and longitude

It is as simple as taking your latitude and longitude from your location and calling geonames.org webservice using the code below

Enjoy.

Update: sorry, "<" was not replaced by "& lt;" and neither did ">" by "& gt;"
$latitude = .....
$longitude = .....
$geonames_call ="http://ws.geonames.org/timezone?lat=" . $latitude . "&lng=" . $longitude;
$output = file_get_contents( $geonames_call );
preg_match("/<timezoneId>(.*?)<\/timezoneId>/ims", $output, $matches);
$timezone = $matches[1];
echo "Timezone = ", $timezone, "<br/>
";

PHP code for reverse geocoding

"Geocoding is the process of converting addresses (like "1600 Amphitheatre Parkway, Mountain View, CA") into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers or position the map. The Google Geocoding API provides a direct way to access a geocoder via an HTTP request. Additionally, the service allows you to perform the converse operation (turning coordinates into addresses); this process is known as "reverse geocoding." "
from http://code.google.com/apis/maps/documentation/geocoding/


Below you can find the PHP code (written by myself) to get the different properties of an address, given the latitude and longitude


Enjoy.

Update: sorry, "<" was not replaced by "& lt;" and neither did ">" by "& gt;"

//
// get latitude and longitude
//
$latitude = ..........
$longitude = .........


//
// XML schema and options for api calls
// are described in http://code.google.com/apis/maps/documentation/geocoding/
//
$mapapis_call ="http://maps.googleapis.com/maps/api/geocode/xml?latlng=" . $latitude . "," . $longitude . "&sensor=false";


$output = file_get_contents( $mapapis_call ); 


// Status of the call
preg_match("/<status>(.*?)<\/status>/ims",$output, $matches);


// Formatted address 
preg_match("/<formatted_address>(.*?)<\/formatted_address>/ims",$output, $matches);
$address = $matches[1];


// Address components with all information of the address
preg_match_all( "/<address_component>(.*?)<\/address_component>/ims", $output, $components, PREG_SPLIT_NO_EMPTY );


// For every component
foreach( $components as $component )
{
//  Loop for each address component
//
foreach( $component as $element )
{
preg_match( "/<type>(.*?)<\/type>/ims", $element, $matches );
$type = $matches[1];

preg_match( "/<long_name>(.*?)<\/long_name>/ims", $element, $matches );
$long_name = $matches[1];

preg_match( "/<short_name>(.*?)<\/short_name>/ims", $element, $matches );
$short_name = $matches[1];

switch( $type )
{
case "locality":
$ciudad = $long_name;
break;
case "country":
$country = $short_name;
break;
case "postal_code":
$postal_code = $long_name;
break;
}
}
}


............





13 octubre 2010

An example of how to keep users unhappy --- The Live Mesh beta is coming to an end

---------- Forwarded message ----------
From: Windows Live Team
Date: Tue, 12 Oct 2010 19:13:43 -0700 (PDT)
Subject: The Live Mesh beta is coming to an end
To: me

You're receiving this message because you used the Live Mesh
beta from Microsoft. On March 31, 2011, the beta of Live Mesh will
end,
and the Live Mesh beta will stop working. After March 31,
you won't be able to access any files stored online in your Live
Desktop
or connect to your PCs remotely using the Live Mesh software.
Your files will also stop syncing between your computers and your
Live Mesh online storage. Please read below for actions we
recommend you take.

With the new release of Windows Live services, we've made a
series of changes and improvements across the products. We realize
they will have an impact on you and we want to make that as
easy as possible for you. We thank you for your continued support
of Windows Live services.

Why is this happening?

To deliver a better product for all our customers, we combined
several services into a new product called Windows Live Mesh.
Windows Live Mesh has several performance and reliability
improvements compared to the Live Mesh beta, and with Windows Live
Mesh, you can also sync your program settings for Internet
Explorer and Microsoft Office.

What you need to do before Live Mesh beta shuts down
To prevent loss of any of your files, please sync all files
from your Live Desktop so that you have them on your
computer when the Live Mesh beta service is shutdown. To do
this, follow these steps:

On your Live Desktop, right-click any Live Mesh folders not
yet synced with your computer, and
then click Sync with this computer. Make sure all the
folders on your Live Desktop have desktop shortcuts.
Select where you want each folder to sync, and then click OK
If a folder has a lot of files,
this might take a while. Open each folder and make sure all
the files are downloaded.

What you can do moving forward

If you enjoyed the functionality of Live Mesh, we encourage
you to install the new Windows Live Mesh. You will first need to
uninstall the Live Mesh beta, and then go to
to get the latest version of Windows Live
Mesh. Before you do this, note the folders that you're
syncing on each computer and if they're shared with anyone.
After you download Windows Live Mesh, you can set up these
folders to sync again.
Learn more about how to upgrade

Thank you for participating in the Live Mesh beta. We hope
you choose to move to Windows Live Mesh.

Sincerely,

The Windows Live team


Why is this happening?
For the last couple of years, Microsoft has offered
two similar services for syncing your files:
Live Mesh beta and another service, called Windows Live Sync,
which let people sync large folders of files
between PCs. To deliver a better product for all our
customers, we decided to combine these sets of features
into a new product called Windows Live Mesh.

Note: Windows Live Mesh is available only for Windows 7,
Windows Vista, Windows Server 2008, and Mac OS X version 10.5 or
later.

What can I expect between now and the date the beta
service shuts down?
The Live Mesh beta service will continue to run
until March 31, 2011. However, we will no longer
accept new beta participants. You won't be able to share Live
Mesh folders with someone unless they already
have Live Mesh installed. On March 31, 2011, you will no
longer be able to sign in to Live Mesh beta on
your PC, Mac, or on the web.

12 octubre 2010

Noticias.calendariolibre.com

As I already told in this blog, Calendariolibre.com has been promoting open source related events for quite a while and every event created in the Ushahidi platform is sent across some other social networks:
Although the main purpose of calendariolibre.com was, and still is, to promote and make those events visible, we thought we could give more value to our followers telling them what is going on in the open knowledge area, adding some headlines news on open source software and hardware, open government, open data ... open knowledge, in general.
We searched for an existing and similar news aggregator and, since they did not reply to our collaboration offer, we decided to do it by ourselves and did set up noticias.calendariolibre.com using tumblr as the underlying blogging platform and dlvr.it to manage the rss feeds.
How it works - veeeeery easy
Step 1: blogs are checked every 15 minutes and new posts are copied to our blog.
Step 2: Every hour the most recent post of our blog is sent to social networks mentioned above.
And results ... so far, so good.
Figures:
Tips:
Anybody can submit news to the aggregator here and, after admin approval, it will be posted.
You can suggest any blog to be added on regular basis as a comment to this post or ... anywhere.