PDA

View Full Version : i want to display thumbnail with gfeedfetcher



behzadg
10-01-2012, 04:26 PM
hi, i want to display thumbnail with gfeedfetcher but i cant

Script url: http://www.dynamicdrive.com/dynamicindex18/gajaxrssdisplayer.htm

i want to display thumbnail from themeforest.net by "gfeedfetcher" script, but i cant fix this problem .
i want show thumbnail and title only, not desc or date ...
please help me .

thanks

ddadmin
10-01-2012, 04:52 PM
What's the URL to the actual RSS feed you want to show?

jscheuer1
10-01-2012, 05:16 PM
I just looked at the first one:

themeforest.net/feeds/new-site-templates-slash-creative-items.atom

There are no thumbnails. There are some images in some of the long descriptions.

Are you sure the feed you want has thumbnails?

behzadg
10-01-2012, 06:56 PM
I just looked at the first one:
themeforest.net/feeds/new-site-templates-slash-creative-items.atom
There are no thumbnails. There are some images in some of the long descriptions.
Are you sure the feed you want has thumbnails?

in this url has thumbnail, title, url and... , do can to display thumbnail and title only from this url:
marketplace.envato.com/api/edge/new-files:themeforest,site-templates.json
marketplace.envato.com/api/documentation

jscheuer1
10-01-2012, 07:19 PM
Those are not rss feeds, they're json files. If you have PHP you can probably import and parse them fairly easily. Using javascript and jQuery, a similar thing can be done, except you still need need PHP or another server side language to get the file. At that point it would probably be easier to parse it with PHP or that other language as well.

Unless Google or some other large host has such a third party service, you would have to do it yourself if your host has PHP.

This:

https://developers.google.com/gdata/docs/json

may or may not be able to be adapted to grab those files so that javascript on your end could interpret them.

But, as I say, with PHP (requires a PHP enabled server that's allowed to fetch files from other domains) it's pretty easy, here's a basic example, save as newfiles.php:


<!DOCTYPE html>
<html>
<head>
<title>New Files</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.item {
border: 1px solid black;
margin: 3px;
float: left;
min-width: 225px;
font: normal 95% sans-serif;
padding: 2px;
background-color: lightyellow;
}
</style>
</head>
<body>
<pre><?php
$rawjson = file_get_contents('http://marketplace.envato.com/api/edge/new-files:themeforest,site-templates.json');
$arrjson = json_decode($rawjson, true);
//print_r($arrjson['new-files'][0]); // <-- this line may be uncommented to see the structure of the first entry
?></pre>
<?php
foreach($arrjson['new-files'] as $newfile){
echo "<div class='item'><a target='_blank' href='{$newfile['url']}'>{$newfile['item']}:<br><img src='{$newfile['thumbnail']}'></a></div>";
}
?>
</body>
</html>