我在一起简单的PHP脚本,将建立我在我的Facebook粉丝页上的相册列表。刮一个网站的URL来获取图像的路径
Facebook慷慨地提供图形API,它给了我一个很好的相册列表,但它们不再提供默认相册图像的路径。
我想编写一个PHP脚本,通过curl加载相册url,并以某种方式获取包含缩略图的表中第一个图像的路径。这将是具有“UIPhotoGrid_Image”类的第一个img标签的“src”值。
的布局代码包含的好东西块看起来是这样的:
<div id="album_container">
<div class="UIPhotoGrid_Container UIPhotoGrid_DefaultPadding">
<table class="UIPhotoGrid_Table" cellpadding="0" cellspacing="0">
<tr>
<td class="UIPhotoGrid_TableCell">
<a class="UIPhotoGrid_PhotoLink clearfix" href="http://www.facebook.com/photo.php?pid=5004658&id=20785087272"><img class="UIPhotoGrid_Image img" src="http://photos-e.ak.fbcdn.net/hphotos-ak-snc4/hs080.snc4/35354_422883027272_20785087272_5004658_704231_s.jpg" onload="this.fb_loaded = true;" /></a>
</td>
<td class="UIPhotoGrid_TableCell">
<a class="UIPhotoGrid_PhotoLink clearfix" href="http://www.facebook.com/photo.php?pid=5004659&id=20785087272"><img class="UIPhotoGrid_Image img" src="http://photos-c.ak.fbcdn.net/hphotos-ak-snc4/hs080.snc4/35354_422883032272_20785087272_5004659_6158094_s.jpg" onload="this.fb_loaded = true;" /></a>
</td>
<td class="UIPhotoGrid_TableCell">
<a class="UIPhotoGrid_PhotoLink clearfix" href="http://www.facebook.com/photo.php?pid=5004660&id=20785087272"><img class="UIPhotoGrid_Image img" src="http://photos-f.ak.fbcdn.net/hphotos-ak-snc4/hs080.snc4/35354_422883037272_20785087272_5004660_1787119_s.jpg" onload="this.fb_loaded = true;" /></a>
</td>
</tr>
</table>
</div>
</div>
这可悲的,是超出了我目前的编码能力......任何想法?