Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/06/2009, 04:47
Pontiac
 
Fecha de Ingreso: junio-2009
Mensajes: 11
Antigüedad: 15 años, 9 meses
Puntos: 2
Respuesta: recibir Datos de una URL (TinyURL)

Muchas gracias,

De hecho ya estaba preparando el javascript y el php... ;) jeje

Lo dejo aquí por si le peude servir a alguien... Se trata de una funcion para publicar el enlace de la url actual, junto con el título a Twitter:

Código Javascript:

Código:
function s_twitter()
  {
  var url=document.getElementById("twitter").href
  var title=document.title
  open("tinyurl.php?url="+url+"&title="+title, "Twitter");
  }
Codigo PHP:

Código PHP:
<?php
$title
=utf8_encode($title); 
$tiny=(trim(file_get_contents('http : //tinyurl.com/api-create.php?url='.$url)));
$twitter "http : //twitter.com/home?status=".$title."  - ".$tiny
Header("Location: $twitter"); 
?>
PD:Las URLs estan con espacios para que me deje publicarlas...

Chao!