sábado, 16 de noviembre de 2013

Google Chars New API - Getting QR Codes

The old API for creating QR codes is deprecated. Here I let you the new one. And the way to get it via POST so you can get a PNG and not any HTML file (as they used to do)

https://developers.google.com/chart/image/docs/post_requests

Create QR Codes

<form action='https://chart.googleapis.com/chart' method='POST'>
    <input type="hidden" name="cht" value="qr"  />
    <input type='hidden' name='chs' value='300x200' />
    <input type="hidden" name="chl" value="What you want inside your QR" />
    <input type='hidden' name='chld' value='H|0=absolute'/>
    <input type="submit"  />
</form> 


viernes, 8 de noviembre de 2013

Google modernizes Octane JavaScript speed test | Internet & Media - CNET News

Google modernizes Octane JavaScript speed test | Internet & Media - CNET News

I like the idea of a faster engine but sometimes -when I do Javascript code for different browser- I prefer to see all these big boys worrying more about how they can be more equals on their interpreters ;-)


martes, 5 de noviembre de 2013

ConvertAPI - Web2Image and more...

This website has a lot of conversion utilities. The one I'm using right now is the one converting webpages to image files.

http://www.convertapi.com/web-image-api

This API will let you do this task in a very easy way. Try their sample:

<h3>Convert web page and return JPG image as stream</h3>
<a href="http://do.convertapi.com/web2image?curl=http://www.google.com">http://do.convertapi.com/web2image?curl=http://www.google.com</a>

http://jsfiddle.net/tomasr/eGhgT/

ConvertAPI - file conversion to PDF API SDK for Python Ruby Java .NET C# PHP Shell Delphi

AJAX Cross Domain - Library

AJAX Cross Domain is a free library that allows to perform AJAX requests between different domains.

topSynopsis
<script type="text/javascript" src="http://www.ajax-cross-domain.com/cgi-bin/ACD/ACD.js?uri=(http://www.google.com)"></script> <script type="text/javascript"> alert(ACD.responseText); </script>


topMotivation
Virtually all modern server-side scripting languages support remote requests in one or another form. In client-side javascript, this functionality is not present due to the Same Origin Policy. Though this policy is necessary for a robust security model, programmers are often handicapped in their wish to send and retrieve requests to remote servers. During the last years, several proposals have been made for a more flexible (re-)design of the XMLHttpRequest object, which is the core mechanism of all AJAX based technologies. AJAX Cross Domain provides in the full functionality of the XMLHttpRequest object in a similar syntax, and can by extent handle all cross-domain requests. The core engine of AJAX Cross Domain is written in Perl and outputs its content as ajavascript file.

topExamples
All code blocks are fully working cut-and-paste examples and can be directly used in your own test pages.
This example alerts the response body of an URL with a query-string:

<script type="text/javascript" src="http://www.ajax-cross-domain.com/cgi-bin/ACD/ACD.js?uri=(http://216.92.131.147/dotserv/ACD/?name=john)"></script> <script type="text/javascript"> alert(ACD.responseText); </script>

This example does a remote request and shows all the response headers:
<script type="text/javascript" src="http://www.ajax-cross-domain.com/cgi-bin/ACD/ACD.js?uri=(http://www.google.com/)"></script> <script type="text/javascript"> alert(ACD.getAllResponseHeaders); </script>

This example returns only a specific header of interest:
<script type="text/javascript" src="http://www.ajax-cross-domain.com/cgi-bin/ACD/ACD.js?uri=(http://www.google.com/)"></script> <script type="text/javascript"> if (ACD.getResponseHeader['Content-Type']) { alert(ACD.getResponseHeader['Content-Type']); } </script>

This example returns the HTTP status code of the response:
<script type="text/javascript" src="http://www.ajax-cross-domain.com/cgi-bin/ACD/ACD.js?uri=(http://www.microsoft.com/)"></script> <script type="text/javascript"> alert(ACD.status); </script>

This example performs a POST request to the given URI and shows the request how it was offered to the remote resource:
<script type="text/javascript" src="http://www.ajax-cross-domain.com/cgi-bin/ACD/ACD.js?uri=(http://216.92.131.147/dotserv/ACD/runit/post.cgi)&amp;method=post&amp;postdata=(name=fred&amp;email=fred@fred.com)"></script> <script type="text/javascript"> alert(ACD.responseText); </script>

If postdata is present, it is assumed that the request method is meant as post even when method=post is not explicitly mentioned. The following example performs a (somewhat more complex percent-encoded) POST-request and returns the response body:
<script type="text/javascript" src="http://www.ajax-cross-domain.com/cgi-bin/ACD/ACD.js?uri=(http://216.92.131.147/dotserv/ACD/runit/post.cgi)&amp;postdata=(name=John%20Johnson&amp;email=john@gmail.com&amp;company=C%26A%20%28until%20May%29&amp;sum=1%2B1%3D2)"></script> <script type="text/javascript"> alert(ACD.responseText); </script>

This example sends a request with header User-Agent set to My cool User-Agent and header Content-Language set to en, and shows the request that was offered to the remote server:
<script type="text/javascript" src="http://www.ajax-cross-domain.com/cgi-bin/ACD/ACD.js?uri=(http://www.google.com)&amp;headers=(User-Agent=My%20cool%20User-Agent&amp;Content-Language=en)"></script> <script type="text/javascript"> alert(ACD.request); </script>

This example generates an error because uri is invalid:
<script type="text/javascript" src="http://www.ajax-cross-domain.com/cgi-bin/ACD/ACD.js?uri=(http/www.google.com)"></script> <script type="text/javascript"> alert(ACD.error); </script>
 

AJAX Cross Domain - ACD

lunes, 4 de noviembre de 2013

Long Polling your Server

If you need to get content from your server and want to do it in an efficient way, so try this sample. It will inform only when changes occur on the server side. Simply magic :-)

Download tutorial files:
https://mega.co.nz/#!VlAwQBDK!EDWmshoVImeZk8YKJX83O29Wezga2hVso9v1Pn_oKg4

Link to a video tutorial:
Screenr - srcoley: A Simple Guide to Long Polling in 5 Minutes #nettuts

Javascript webpage to image

This guy is a genius! So I wanted to share with you this solution for capturing on client-size a full html page and convert it to image.

All solutions out there are doing this job but on the server side. And that could be a problem if you are planing to receive thousands of visits. So, by doing this on client-side, you can stop worrying ;-)

Link to the website: http://html2canvas.hertzen.com/screenshots.html
Download: https://github.com/niklasvh/html2canvas

sábado, 2 de noviembre de 2013

Tululoo, Game Engine para HTML5

Tululoo, para desarrollar juegos en HTML5

tululoo

Descubrimos vía Seetio a Tululoo Game Maker, una herramienta pensada para la creación de videojuegos en HTML5 basados en navegador y jugables desde dispositivos móviles, teniendo en cuenta que los smartphones más recientes soportan los últimos estándards de HTML5.
Tululoo nos ofrece varias herramientas para ello, como un manager de recursos y un editor de scripts con el que importar imágenes, fondos, sprites animados y sonidos así como la posibilidad de crear distintos objetos (coleccionables, personajes, enemigos, etc.) y funciones.

Obviamente, la herramienta nace orientada para aquellos que dispongan de nociones básicas o avanzadas de programación, pero en este caso la creación de código no será compleja ya que Tululoo cuenta con características como completar el código automáticamente o resaltar ciertas partes de la sintaxis, para que dentro de lo complejo el proceso se nos haga lo más fácil posible. Otras cosas que podremos ver en Tululoo serán detalles como soporte para archivos de audio WAV, MP3 y OGG, soporte para jugar con teclado, ratón y touchpad, creación de objetos en tiempo real, etc.

Si queréis ver algunos ejemplos de lo que puede llegar a desarrollarse con Tululoo, podéis acceder a diversos juegos desarrollados con la herramienta en la sección “Games“. Lo mejor de todo, dejando de lado lo útil que puede ser para desarrolladores independientes de videojuegos, es que la herramienta es gratuita (si nos encanta y queremos colaborar en su mantenimiento y desarollo, podemos realizar donaciones desde la misma página web).

Visto en: http://wwwhatsnew.com/2013/10/28/tululoo-para-desarrollar-juegos-en-html5/