Import the Digg Feed

By michal frackowiakmichal frackowiak

Description

It is easy to import a news feed in the "easy" way. But let us say you want full-blown news from Digg… OK, here it is. Let's use the "Technology" feed located at http://digg.com/rss/containertechnology.xml

For more info please also look at the Feed module documentation.

Code

[[module Feed src="http://digg.com/rss/containertechnology.xml" limit="10"]]
[[div style="float:left;background-color: #ffea6b; background-image: url(http://digg.com/img/digg-box-1-shade-5.gif); width:4em; text-align: center; margin: 0 0.5em 0.5em 0;border-bottom: 1px solid #edda67; border-right: 1px solid #edda67; color: #555;"]]
[[size large]]**%%custom digg:diggCount%%**[[/size]]
diggs
[[/div]]
[[div style="margin-left: 5em"]]
++ %%linked_title%% 
[[span style="color: #666; font-size: smaller"]] [[image %%custom_digg:submitter_userimage%% width="16" height="16" style="vertical-align: -0.3em;"]] submitted by  [http://digg.org/users/%%custom_digg:submitter_username%% %%custom_digg:submitter_username%%]  on %%date%%[[/span]]

%%description%%

[[span style="font-size: smaller; padding-top: -1em;"]] [%%link%% %%custom_digg:commentCount%% Comments] | [%%link%%/blog Blog this] | [%%link%%/share Email this] | Topic: %%custom digg:category%%
[[/span]] 
[[/div]]
[[/module]]

In action

{"module":"feed\/FeedModule","params":{"src":"http:\/\/digg.com\/rss\/containertechnology.xml","limit":"10","module_body":"[[div style=\"float:left;background-color: #ffea6b; background-image: url(http:\/\/digg.com\/img\/digg-box-1-shade-5.gif); width:4em; text-align: center; margin: 0 0.5em 0.5em 0;border-bottom: 1px solid #edda67; border-right: 1px solid #edda67; color: #555;\"]]\n[[size large]]**%%custom digg:diggCount%%**[[\/size]]\ndiggs\n[[\/div]]\n[[div style=\"margin-left: 5em\"]]\n++ %%linked_title%% \n[[span style=\"color: #666; font-size: smaller\"]] [[image %%custom_digg:submitter_userimage%% width=\"16\" height=\"16\" style=\"vertical-align: -0.3em;\"]] submitted by [http:\/\/digg.org\/users\/%%custom_digg:submitter_username%% %%custom_digg:submitter_username%%] on %%date%%[[\/span]]\n\n%%description%%\n\n[[span style=\"font-size: smaller; padding-top: -1em;\"]] [%%link%% %%custom_digg:commentCount%% Comments] | [%%link%%\/blog Blog this] | [%%link%%\/share Email this] | Topic: %%custom digg:category%%\n[[\/span]] \n[[\/div]]"}}

You can of course improve the formatting or customize the feed. In particular you can of course combine several feeds — just separate different RSS sources by a coma delimiter (",").

The hack presented above does not aim to reproduce the exact digg-style but shows that using the simple tricks you can come quite close. And of course it demonstrates the power of Wikidot ;-)

For more details please consult the Feed module documentation.


Thanks to tsangk for this great snippet: conditional-blocks


text above inserted with:

[[include :snippets:if START |unique=1|type=equal|var1=%%name%%|var2=conditional-blocks]]
**##red|Thanks to tsangk for this great snippet:##** [[[code:conditional-blocks]]]
[[include :snippets:if END]]



Other snippets posted by michal frackowiak

Todo List - 18 Aug 2014 15:28
Multicolumn Layout - 17 Dec 2012 19:51
Zoho Writer - 16 Feb 2012 01:57
Zoho Sheet - 16 Feb 2012 01:56
Zoho Show - 16 Feb 2012 01:55
Zoho Polls - 16 Feb 2012 01:53
WoW Tooltips - 16 Feb 2012 01:52
Widgetbox Panel - 16 Feb 2012 01:52
Video from Revver - 16 Feb 2012 01:50
Tabs - 16 Feb 2012 01:45
Standalone Page Buttons - 16 Feb 2012 01:44
Social Bookmarking - 16 Feb 2012 01:42
Simple Gallery - 16 Feb 2012 01:41
Remember The Milk Todo - 16 Feb 2012 01:39
Recent Changes (mini) - 16 Feb 2012 01:36
Rating Summary - 16 Feb 2012 01:35
Quimble Poll - 16 Feb 2012 01:33
Quikmaps Maps - 16 Feb 2012 01:33
Photobucket Widget - 16 Feb 2012 01:29
Page Previews (Snap.com) - 16 Feb 2012 01:29
Pabpixies Gadgets - 16 Feb 2012 01:28
MyBlogLog recent visitors - 16 Feb 2012 01:25
Meebo me - 16 Feb 2012 01:20
Layout With Tables - 16 Feb 2012 01:19
Instacalc - 16 Feb 2012 01:12
Include Any Page - 16 Feb 2012 01:11
Import a News Feed - 16 Feb 2012 01:10
Google Gadgets - 16 Feb 2012 01:05
Gabbly chat - 16 Feb 2012 01:02
Forum Summary for the Front Page - 16 Feb 2012 01:02
Footnotes - 16 Feb 2012 01:01
Foldable List - 16 Feb 2012 01:01
Flickr Images By Tags - 16 Feb 2012 01:00
Feedburner - 15 Feb 2012 00:53
Extra Side Bar - 15 Feb 2012 00:51
Embed Code From Other Services - 15 Feb 2012 00:50
EditGrid Spreadsheets - 15 Feb 2012 00:49
Cornify - 15 Feb 2012 00:39
Compact Feed Display - 15 Feb 2012 00:35
Collapsible Text Block - 15 Feb 2012 00:35
Center Video - 15 Feb 2012 00:28
Bibliography/Footnotes/Comments Listed in TOC - 15 Feb 2012 00:26
Babelfish Translation - 15 Feb 2012 00:25
Automatic Sitemap - 15 Feb 2012 00:25
Alexa traffic ratings - 15 Feb 2012 00:23
3d tagcloud - 15 Feb 2012 00:22


Rate this solution

If you think this solution is useful — rate it up!

rating: +12+x
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License