I have a local social-bookmarking site powered by Drigg http://drupal.org/project/drigg very similar to Digg.com -- users submit links and vote for best external articles - very similar to Digg.com
The problem is that people don't bother uploading images into imagefield, so the pages look quite empty, and it would be nice to have at least some images automatically generated from the external link.

The trouble with Drigg is that it creates its own "Scoop" content type which comes with its own "Scoop's URL" field (so CCK Link field is out of the question). I wonder if Websnapr could be made to work with that URL field???

Thank you.

Comments

MyFriendsHotel’s picture

Version: 6.x-6.x-dev » 6.x-1.0
Issue tags: +drigg, +Websnapr

HI, I found a website a year+ ago showing how to integrate websnapr but that site is no longer active.

I had the code working on my Drigg site - http://weblinks.myfriendshotel.com until the latest update...I'm trying to find a fix. If you can help that would be great!

The code I have is as below -

line 25 of the node-drigg.tpl.php file. (note: 'Websnapr Key' should be your code)

<?php if ($teaser) { ?>
<div class="embedded-teaser">
<?php if ($embedded_stuff) { ?>
<?php print $embedded_stuff ?>
<?php } else { ?>
<div style="embedded-youtube teaser thumbnail">
<a href="<?php print $node->url; ?>">
<img src="http://images.websnapr.com/?size=size&key=WEBSNAPR-CODE&url=<?php print $node->url;?>"> 
</div>
<?php } ?>
</div>
<?php } ?>

Do let me know / post here if you have any luck applying the new code :o)

Thanks,
Pete

drupalina’s picture

Hi MyFriendHotel,

After trying to find at least some decent support documentation on the new websnapr code (how to display thumbnails) and failing miserably, I just switched to another service called ShrinkTheWeb. You just register and they give you a sample code for bing (for example) and you change that, and paste it into your node-drigg.tpl.php.

So here's the code that works for me:

<?php if (!$embedded_stuff && !$node->field_image): { ?> <!-- Basically, for those nodes that don't have embedded video or imagefield called "image" -->
	<div style="float:right;">
	<a href="<?php print drigg_link($node); ?>">
	<img src="http://images.shrinktheweb.com/xino.php?stwembed=1&stwaccesskeyid=PUT_YOUR_KEY_HERE&stwsize=sm&stwurl=<?php print $node->url;?>" ></a>
	</div>
	<?php } endif; ?>

On my site I have the extlink module so all external links should open in a new tab. The weird thing is that now I notice that when you click the link, it will open it in a new tab AS WELL AS in the original tab. I nearly went crazy yesterday trying to figure this out (disabling all of my recently updated modules, going back to a clear drigg_theme, etc), but could not find the cause of such sudden behavior. Very annoying... because it makes my site effectively faulty! Have you or anyone else bumped into such problem with Drigg? In any case, I don't think that it has to do with this new code.

Try it and let me know how it goes.

MyFriendsHotel’s picture

Hi drupalina,

thank for sharing the spoils of your hard work...I'll have a play tomorrow and see if the same error occurs at my end.

I'll keep you posted...

MyFriendsHotel’s picture

Hi drupalina,

I've played around with this for hours and I can't get rid of Websnapr and therefore can't install your fix! I remove the details from the file listed above and nothing changes. I've tried to go through all the files on the Drigg install to find where else is might be hiding and I can't find it! Arrgh!! It's as if the file might be on another server...

I know how to use FireBug a bit but I can get it to point to the folder showing the relevant file.

Can you help at all or I might switch the whole thing to Wordpress which I have a bit more experience with, but that would be a real pain in the...

Thanks very much if you can.
Pete

MyFriendsHotel’s picture

Hi drupalina,

You're a star and I have the images working now which is great news! Thank you so much :o)

Here's the finished result - http://weblinks.myfriendshotel.com

Best wishes,

Pete