Adding a NewsTrust Rate This button to your site
NewsTrust is a site where users can submit stories from the news and blog sites to be reviewed for their journalistic qualities. Numerous people have asked about adding links to their stories so that they readers can submit a story directly. There is a link that can be used for this, and with a little work, can be incorporated nicely into one’s content management system.
I am using Drupal for my websites, so my first example is how to do this with Drupal. It is likely to be different for different systems, so hopefully people can use this example to incorporate a NewsTrust link into their own systems. Time permitting, I will try to add a NewsTrust link to other sites that I run and provide examples for those types of content management systems.
In Drupal, I am using the theme editor module, which makes it easy to change my theme on the fly. You can make the same sort of changes to other themes. In the node section for your theme, you want to add a line that links to the NewsTrust site. It should start with the pointer to NewsTrust story submission bookmarklet. Currently that link is
http://www.newstrust.net/webx?storySubmitBookmarklet@@!
Then, you need to start providing the parameters. The first parameter is ‘url’. This should be the URL that points to the specific story. In Drupal the following PHP code provides a good pointer to the URL:
<?php print url($node_url,NULL,NULL,TRUE) ?>
The second parameter is title. It needs to be sent in raw url encoding. In Drupal, you can pass this as
<?php print rawurlencode($title) ?>
That is really all that is needed. However, there are other parameters that can be used. Since this is my blog, I set story_type to Blog%20Post and publication_type to Blog. Since my blog isn’t listed yet, I set publication_name to Other.
I like to set the journalist_names parameter to the name associated with the Drupal id:
<?php global $user; print rawurlencode($user->name);> I set the story_date to the date that the entry was most recently changed, using the following code to get the proper date format:
<php print date("Y-m-d-H.i.s",$node->changed) ?>
Two other fields worth using are unlisted_publication_name and story_quote. For the time being, I may not use story_quote because I too often bury my lead. However, I am adding unlisted_publication_name to my feed.
It is also worth noting that The New Standard now has a link for reviewing their stories on NewsTrust.
Future enhancements to NewsTrust are likely to include the ability to show the current rating of the entry on NewsTrust. This and other examples of integrating with NewsTrust will be forthcoming.
Update 11/12/2007: NewsTrust has updated their site, and I've updated this message to reflect the changes. Most importantly, you should now use http://www.newstrust.net instead of http://beta.newstrust.net
In addition, they have added server side javascript to make it easier to add the Newstrust button.
<script type='text/javascript'>
newstrust_icon = 'http://www.newstrust.net/Images/newstrust.gif';
</script>
<script id="newstrust_button_script" src="http://www.newstrust.net/js/submit_story.js" type="text/javascript"></script>
produces:
This is good for when the visitor has the specific story open, but isn't good for pages that list multiple stories on it.