Skip to content
maparrar edited this page Mar 30, 2013 · 17 revisions

Description / Descripción

Linkparser has two components, a JQuery plugin and server-side scripts to process the links. The two components are required to function well Linkparser. For the server side requires the use of two classes Parser and Curl, which are called from the script fetch.php. Information exchange is done via Ajax. See the example included in the code!

Linkparser tiene dos componentes, un plugin de JQuery y scripts del lado del servidor para procesar los enlaces. Se requieren los dos componentes para que Linkparser funcione bien. Para el lado del servidor se requiere el uso de las dos clases Parser y Curl, que son llamadas desde el script fetch.php. El intercambio de información se hace por medio de Ajax. Consulte el ejemplo incluido en el código!

How to use / Cómo usar

Server side / En el servidor

fetch.php must be accessible to the plugin, the example is in /php/fetch.php.

El script fetch.php debe ser accesible para el plugin, en el ejemplo está en el directorio /php/fetch.php.

Client side / En el cliente

  • Include JQuery / Incluir JQuery
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  • Include Linkparser and the CSS / Incluir Linkparser y su hoja de estilos
<link href="linkparser/linkparser.css" type="text/css" rel="stylesheet">
<script src="linkparser/jquery.linkparser.min.js"></script>
  • Assign the plugin to an element and setup / Asignar el plugin a un elemento y configurarlo
$("#firstExample").linkparser({
   fetchScript:"php/fetch.php",
   urlDefault:"http://www.redsunsoft.com/2011/01/parse-link-like-facebook-with-jquery-and-php/"
});
  • Edit the CSS to define the size of the plugin / Editar el CSS para definir el tamaño del plugin
.linkparser{
    height: 150px;
    width: 600px;
}