Title and Author NOT SHOWN THE SOURCE CODE

132 views
Skip to first unread message

hipotecamix

unread,
Jan 15, 2012, 7:24:36 PM1/15/12
to panora...@googlegroups.com
Hello
I'm using the Panoramio API to display photos on my website.
Recently I noticed that now the title and author of the photo, not shown in the source code of the page
But though he were displayed in the source code and it took google robot
Have there been any change in the API?
How can you do to get the title and author of the photo is displayed in the source code?
thanks

Hola
Soy usuario del api panoramio para mostrar fotos en mi web.
Recientemente he notado que ahora los titulos y el autor de la foto, no se muestran en el codigo fuente de la página
Antes si se mostraban en el codigo fuente y el robot de google les tomaba
¿Ha habido algún cambio en el API?
¿Como se puede  hacer para  que los titulos y autor de la foto se muestren en el codigo fuente?
Gracias

hipotecamix

unread,
Jan 27, 2012, 12:00:29 PM1/27/12
to panora...@googlegroups.com
Este es el  código que tengo. Las fotos se muestran bien en la web pero en el  código fuente de la página no se muestra  el título y el autor de la foto

This is the code I have. The photos show up well on the web but in the source code of the page does not display the title and author of the picture

 <script type="text/javascript">
   var pfotos;
   var resultados;
   function mostrarfotos(panoramio)
   {
      pfotos = panoramio.photos;
      var html='';
      resultados = document.getElementById('resultados');
      resultados.innerHTML = '';
      if (pfotos.length > 0)
      {
         for (var i = 0; i < pfotos.length; i++)
         {
            html += '<div class="item-foto">';
            html += '<a target="_blank" href="' + pfotos[i].photo_url + '"><img width="' + pfotos[i].width + '" height="' + pfotos[i].height + '" src="' + pfotos[i].photo_file_url + '" alt="' + pfotos[i].photo_title + '" border="0"/></a>';
            html += '<br/>';
             html += '<small><a target="_blank" class="photo_title' + pfotos[i].photo_title + '">' + pfotos[i].photo_title + '<\/a></small>';
            html += '<small>, por <a target="_blank" class="owner_name" href="' + pfotos[i].owner_url + '">' + pfotos[i].owner_name + '<\/a></small>';
            html += '</div>';
         }
         html += '<div class="clear"></div>';
         resultados.innerHTML = html;
      }
      else
      {
         resultados.innerHTML = '<strong>No hay fotos disponibles para este municipio</strong>';
      }
   }
</script>
Any idea why the title is not in the source code?

As I say, on the web if you are not in the source code for the robots to index it.

¿Alguna idea porque no se ve el titulo en el código fuente?

Como digo, en la web si se muestran pero no en el código fuente para que lo indexen los robots.
Message has been deleted

QuentinUK

unread,
Jan 29, 2012, 4:19:57 PM1/29/12
to panora...@googlegroups.com
See Small Program to show Square Photos this works OK, you can test it and compare with yours.

I notice 
photo_title  = photoTitle
photo_url  = photoUrl 
owner_name = ownerName
owner_url = ownerUrl


choose the size of image you want from the array, you can use the ids below

 
 var photoPixelsUrl=photo.photoPixelsUrls[imageSizes.isSmall];
photo_file_url = photoPixelsUrl.url
height = photoPixelsUrl.height
width = photoPixelsUrl.width




var imageSizes={
    isMedium:0,
    isIw_Thumbnail:1,
    is1920x1280:2,
    isLarge:3,
    isThumbnail:4,
    isSquare:5,
    isSmall:6,
    isMini_Square:7
};

 

hipotecamix

unread,
Jan 30, 2012, 6:41:28 AM1/30/12
to panora...@googlegroups.com
Thanks for your answer Quentinuk
The problem is that I have no knowledge of programming and I find it very difficult to apply the changes you report me
I have now the code works perfectly but the source code has failed to show the titles and it is important for the robot to index the titles of the photos.
For me it would be easier to do some minor modification to the script I have now.
In addition, the scritp I need is to be based on coordinates.
Thank you very much again

QuentinUK

unread,
Jan 30, 2012, 11:41:37 AM1/30/12
to panora...@googlegroups.com
All you have to do is replace the old names with the new names. And select the image size you want. 
Here, replace lines from html += '<div class="item-foto">'; to the line  html += '</div>'; with the following:-

html += '<div class="item-foto">';
var photo=pfotos[i];
var pixels=photo.photoPixelsUrls[6];// select image number 6 = small
html += '<a target="_blank" href="' + photo.photoUrl + '"><img width="' + pixels.width + '" height="' + pixels.height + '" src="' + pixels.url + '" alt="' + photo.photoTitle + '" border="0"/></a>';
html += '<br/>'; 
//      Did this ever work?   href = "' has gone from your code????????   why was it <\/a>????????
html += '<small><a target="_blank" class="photo_title" href="'+ photo.photoTitle + '">' +photo.photoTitle+ '</a></small>';
html += '<small>, por <a target="_blank" class="owner_name" href="' + photo.ownerUrl + '">' +photo.ownerName+ '</a></small>';
html += '</div>';

hipotecamix

unread,
Jan 30, 2012, 12:28:12 PM1/30/12
to panora...@googlegroups.com
<\ a> I do not know because it was so
but the photos look good but the titles are not displayed in the source code.

With the code you've put the script does not load photos

As I say, I have no programming knowledge so better leave it at least the photos can be viewed when the user visits.

junk0128

unread,
Jan 30, 2012, 7:13:39 PM1/30/12
to panora...@googlegroups.com
Are you using HTML5?

HTML5: `</` can not be written directly inside <SCRIPT>~</SCRIPT>.
An escape is required.    '</a>'  =>  '<\ a>'

hipotecamix

unread,
Jan 30, 2012, 7:19:30 PM1/30/12
to panora...@googlegroups.com
I do not use HTML 5
The script came to me in a forum and had already put this code <\ / a> and I do not know what their function.

About the title in the source code, I've been thinking that it is possible that if I can google robot to index the title and author and not see in the source code because it works with files that have Json all information provided by Panoramio.

junk0128

unread,
Jan 30, 2012, 8:58:27 PM1/30/12
to panora...@googlegroups.com
Correction

HTML5: `</` can not be written directly inside <SCRIPT>~</SCRIPT>.
An escape is required.    '</a>'  =>  '<\/a>'

If you are not using the HTML5, escape is not necessary.

Do you want the sample which displays a title and an author?
Is it a sample which uses Panoramio Data API?

junk0128

unread,
Jan 31, 2012, 9:09:48 AM1/31/12
to panora...@googlegroups.com
Is your browser IE8?

In IE8, the following line became an error.
    resultados = document.getElementById('resultados');
   
It operated in Chrome, firefox, and IE9.
-----

Two line cuts
    resultados = document.getElementById('resultados');
    resultados.innerHTML = '';


One line is corrected.
    resultados.innerHTML = html;
        ↓
    document.getElementById('resultados').innerHTML = html;

-----
IE8 operated now. Of course, other browsers operated.

junk0128

unread,
Feb 2, 2012, 3:29:20 AM2/2/12
to panora...@googlegroups.com
The error of IE8 was my copy mistake.
The display of a title and an author was possible at IE8.
Reply all
Reply to author
Forward
0 new messages