User:Ark25/RefScript

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Description[edit]

This is a JavaScript bookmarklet, very useful if you want to create citations (references) with a single click.

Say you have the following newspaper articles and you want to use them as citations:

The script can transform those links into this:

References using {{cite web}}:

<ref name="MyUser_BBC_May_20_2014c">{{cite web |url=http://www.bbc.com/news/science-environment-23814524 |title=Sea otter return boosts ailing seagrass in California |newspaper=BBC |date= August 26, 2013 |author=Suzi Gage |accessdate=May 20, 2014}}</ref>

<ref name="MyUser_Daily_Mail_May_20_2014c">{{cite web |url=http://www.dailymail.co.uk/news/article-2384832/Great-White-sharks-hunt-seals-South-Africa.html |title=Dinner in the 'Ring of Death': Breathtaking pictures of Great White sharks bursting from the sea to pick off seals |newspaper=Daily Mail |date= August 5, 2013 |author=Rosie Taylor |accessdate=May 20, 2014}}</ref>

<ref name="MyUser_Ars_Technica_May_20_2014c">{{cite web |url=http://arstechnica.com/science/2012/04/organisms-that-once-stuck-to-rocks-evolved-the-ability-to-move-out-of-the-way-of-predators/ |title=Evolution in motion: organisms once stuck to rocks can now evade predators |newspaper=Ars Technica |date= April 17, 2012 |author=John Timmer |accessdate=May 20, 2014}}</ref>

Plain references:

<ref name="MyUser_BBC_May_20_2014r">[http://www.bbc.com/news/science-environment-23814524 Sea otter return boosts ailing seagrass in California], August 26, 2013, Suzi Gage, ''BBC'', retrieved at May 20, 2014</ref>

<ref name="MyUser_Daily_Mail_May_20_2014r">[http://www.dailymail.co.uk/news/article-2384832/Great-White-sharks-hunt-seals-South-Africa.html Dinner in the 'Ring of Death': Breathtaking pictures of Great White sharks bursting from the sea to pick off seals], August 5, 2013, Rosie Taylor, ''Daily Mail'', retrieved at May 20, 2014</ref>

<ref name="MyUser_Ars_Technica_May_20_2014r">[http://arstechnica.com/science/2012/04/organisms-that-once-stuck-to-rocks-evolved-the-ability-to-move-out-of-the-way-of-predators/ Evolution in motion: organisms once stuck to rocks can now evade predators], April 17, 2012, John Timmer, ''Ars Technica'', retrieved at May 20, 2014</ref>

External links:

The references will show in the „Notes” section like this:

Using {{cite web}}: [1] [2] [3]

Plain references: [4] [5] [6]

Notes
  1. ^ Suzi Gage (26 August 2013). "Sea otter return boosts ailing seagrass in California". BBC. Retrieved 2013-09-19. 
  2. ^ Rosie Taylor (5 August 2013). "Dinner in the 'Ring of Death': Breathtaking pictures of Great White sharks bursting from the sea to pick off seals". Daily Mail. Retrieved 2013-09-19. 
  3. ^ John Timmer (17 April 2012). "Evolution in motion: organisms once stuck to rocks can now evade predators". Ars Technica. Retrieved 2013-09-19. 
  4. ^ Sea otter return boosts ailing seagrass in California, 26 August 2013, Suzi Gage, BBC, retrieved at 2013-09-19
  5. ^ Dinner in the 'Ring of Death': Breathtaking pictures of Great White sharks bursting from the sea to pick off seals, 5 August 2013, Rosie Taylor, Daily Mail, retrieved at 2013-09-19
  6. ^ Evolution in motion: organisms once stuck to rocks can now evade predators, 17 April 2012, John Timmer, Ars Technica, retrieved at 2013-09-19

By default, the script generates the reference using the {{cite web}} template. If you want to produce a plain reference, then change in the last line of the script: "prompt("Wiki-Reference", sc);" with "prompt("Wiki-Reference", sr);"

If you want to produce just an external link, then change "prompt("Wiki-Reference", sc);" with "prompt("Wiki-Reference", s);"


If the script doesn't know a specific website, it will capture at least the title of the article and the name of the website. For example, the script doesn't know the Techcrunch.com site at this moment but it will transform this link: http://techcrunch.com/2013/09/16/box-acquisitions-preview-mobile/ into an external link like this:

or into a reference like this:

<ref name="Techcrunch.com_2013-09-19c">{{cite web |url=http://techcrunch.com/2013/09/16/box-acquisitions-preview-mobile/ |title=With New File Preview And Mobile Experiences, Box Highlights Recent Acquisitions |newspaper=Techcrunch.com |date= |last= |accessdate=2013-09-19}}</ref>

How to use the script[edit]

The easiest way to use the script is to go to this webpage and drag the script into your bookmark toolbar. Then you are done.

The old procedure:

All you have to do is to create a bookmark. Instead of putting into the bookmark an URL, you put the script. It's a nice feature of modern internet browsers, so you can create bookmarks that run scripts - they are called Bookmarklets.

  • Edit the section that contains the script: User:Ark25/RefScript#The script - you can do that simply by clicking here
  • Copy all the script into your clipboard (without the <syntaxhighlight lang="javascript"> and the </syntaxhighlight> - the script begins with javascript:..)
  • Create a new bookmark into your browser. Name it "RefScript" or whatever you want. Paste the content of your clipboard into the URL field of that bookmark. In Firefox, the field is called Location. In Google Chrome it's called URL.
  • Save the bookmark

Improving the script[edit]

For the moment, the script can only handle a few sites (BBC, Daily Mail, Daily Mirror, The Daily Telegraph, Huffington Post, Huffington Post Canada, The New York Times, The Washington Post, The Boston Globe, The Times of India, Financial Times, The Economist, Wall Street Journal, Business Week, Ars Technica, TG Daily), but the good part is that everyone can teach the script how to handle a new website. If for example you are using a lot The New York Times for citations, you can teach the script how to find the key elements (title, author, date) into that newspaper's online articles and then you can save a lot of time by creating citations with a single click. I am not using often English newspapers for the citations I create, but I developed the script to handle about 30-40 most important Romanian newspapers and that's helping me a lot.

If you can't manage to add code to the script, then ask me to add code for the newspaper you need, and I will try to do it, depending on how much free time I have.

See also[edit]

The script[edit]

javascript:var Manifest = '   RefScript version 44b (2014-11-13). This program is in the Public Domain. You can use it as you wish.   ';
var User_Prefix = 'MyUser';
var Date_Format = 'US';
   var comment = 'Date_Format can be US (May 9, 2014) or UK (9 May 2014) or YMD (2014-05-09) - for access date (retrieved at)';
var Archive = 'No';
var Ref_Name_Short = 'No';
var Ref_Name_Date_Publication_Date='No';
var Without_Reference_Name='No';
var SiteLN = 'en';
var AuthorNameTitleCase = 'Yes';
function toTitleCase(str) {
  var str = str.toLowerCase();
  return str.replace(/[^\s]+/g, function(word) {
      return word.replace(/^./, function(first) {
        return first.toUpperCase();
      });
    });
};
function f_process_Newspaper_Name() {
  var P_Newspaper = u.replace(/\.com.*/, '.com');
  var P_Newspaper = P_Newspaper.replace(/\.net.*/, '.net');
  var P_Newspaper = P_Newspaper.replace(/\.co.uk.*/, '.co.uk');
  var P_Newspaper = P_Newspaper.replace(/\.org.*/, '.org');
  var P_Newspaper = P_Newspaper.replace(/\.net.*/, '.net');
  var P_Newspaper = P_Newspaper.replace(/\.ca\/.*/, '.ca');
  var P_Newspaper = P_Newspaper.replace(/http:\/\/www./, '');
  var P_Newspaper = P_Newspaper.replace(/http:\/\//, '');
  var P_Newspaper = P_Newspaper.replace(/\/.*/, '');
  var P_Newspaper = toTitleCase(P_Newspaper);
 
  return P_Newspaper;
};
function f_process_Title(P_Title) {
  var P_Title = P_Title.replace(/’/g, '\'');
  var P_Title = P_Title.replace(/\s*\|.*/, '');
  var P_Title = P_Title.replace(/\[/g, '(');
  var P_Title = P_Title.replace(/\]/g, ')');
  var P_Title = P_Title.replace(/^ +/, '');
  var P_Title = P_Title.replace(/ +$/, '');
 
  return P_Title;
};
function f_process_EN_Date(P_Date) {
 
  var P_Date = f_remove_weekday_from_EN_Date(P_Date);
  var P_Date = P_Date.replace(/Published: */i, '');
  var P_Date = P_Date.replace(/Updated */i, ''); 
  var P_Date = P_Date.replace(/,? *\w*:.*$/, '');
 
  var P_Date = P_Date.replace(/\n/g, ' ');
  var P_Date = P_Date.replace(/\t/g, ' ');
  var P_Date = P_Date.replace(/^ +/, '');
  var P_Date = P_Date.replace(/ +$/, '');
  var P_Date = P_Date.replace(/^0/, '');
  var P_Date = P_Date.replace(/ +/g, ' ');
 
  var P_Date = P_Date.replace(/Jan\.? /, 'January ');
  var P_Date = P_Date.replace(/Feb\.? /, 'February ');
  var P_Date = P_Date.replace(/Mar\.? /, 'March ');
  var P_Date = P_Date.replace(/Apr\.? /, 'April ');
  var P_Date = P_Date.replace(/Jun\.? /, 'June ');
  var P_Date = P_Date.replace(/Jul\.? /, 'July ');
  var P_Date = P_Date.replace(/Aug\.? /, 'August ');
  var P_Date = P_Date.replace(/Sept? /, 'September ');
  var P_Date = P_Date.replace(/Sept\. /, 'September ');
  var P_Date = P_Date.replace(/Oct\.? /, 'October ');
  var P_Date = P_Date.replace(/Nov\.? /, 'November ');
  var P_Date = P_Date.replace(/Dec\.? /, 'December ');
 
  var P_Date = P_Date.replace(/January 0/, 'January ');
  var P_Date = P_Date.replace(/February 0/, 'February ');
  var P_Date = P_Date.replace(/March 0/, 'March ');
  var P_Date = P_Date.replace(/April 0/, 'April ');
  var P_Date = P_Date.replace(/May 0/, 'May ');
  var P_Date = P_Date.replace(/June 0/, 'June ');
  var P_Date = P_Date.replace(/July 0/, 'July ');
  var P_Date = P_Date.replace(/August 0/, 'August ');
  var P_Date = P_Date.replace(/September 0/, 'September ');
  var P_Date = P_Date.replace(/October 0/, 'October ');
  var P_Date = P_Date.replace(/November 0/, 'November ');
  var P_Date = P_Date.replace(/December 0/, 'December ');
 
  var P_Date = P_Date.replace(/\.01\./, ' January ');
  var P_Date = P_Date.replace(/\.02\./, ' February ');
  var P_Date = P_Date.replace(/\.03\./, ' March ');
  var P_Date = P_Date.replace(/\.04\./, ' April ');
  var P_Date = P_Date.replace(/\.05\./, ' June ');
  var P_Date = P_Date.replace(/\.06\./, ' July ');
  var P_Date = P_Date.replace(/\.07\./, ' August ');
  var P_Date = P_Date.replace(/\.08\./, ' September ');
  var P_Date = P_Date.replace(/\.09\./, ' September ');
  var P_Date = P_Date.replace(/\.10\./, ' October ');
  var P_Date = P_Date.replace(/\.11\./, ' November ');
  var P_Date = P_Date.replace(/\.12\./, ' December ');
 
  return P_Date;
};
function f_process_DateUK_to_DateYMD(P_Date) {
 
  var P_Date = P_Date.replace(/^(.) /, '0$1 ');
 
  var P_Date = P_Date.replace(/ January /, ' 01 ');
  var P_Date = P_Date.replace(/ February /, ' 02 ');
  var P_Date = P_Date.replace(/ March /, ' 03 ');
  var P_Date = P_Date.replace(/ April /, ' 04 ');
  var P_Date = P_Date.replace(/ May /, ' 05 ');
  var P_Date = P_Date.replace(/ June /, ' 06 ');
  var P_Date = P_Date.replace(/ July /, ' 07 ');
  var P_Date = P_Date.replace(/ August /, ' 08 ');
  var P_Date = P_Date.replace(/ September /, ' 09 ');
  var P_Date = P_Date.replace(/ October /, ' 10 ');
  var P_Date = P_Date.replace(/ November /, ' 11 ');
  var P_Date = P_Date.replace(/ December /, ' 12 ');
 
  var P_Date = P_Date.replace(/(.*) (.*) (.*)/, '$3-$2-$1');
 
  return P_Date;
};
function f_process_DateYMD_to_DateUK(P_Date) {
 
  var P_Date = P_Date.replace(/^(.) /, '0$1 ');
 
  var P_Date = P_Date.replace(/-01-/, ' January ');
  var P_Date = P_Date.replace(/-02-/, ' February ');
  var P_Date = P_Date.replace(/-03-/, ' March ');
  var P_Date = P_Date.replace(/-04-/, ' April ');
  var P_Date = P_Date.replace(/-05-/, ' May ');
  var P_Date = P_Date.replace(/-06-/, ' June ');
  var P_Date = P_Date.replace(/-07-/, ' July ');
  var P_Date = P_Date.replace(/-08-/, ' August ');
  var P_Date = P_Date.replace(/-09-/, ' September ');
  var P_Date = P_Date.replace(/-10-/, ' October ');
  var P_Date = P_Date.replace(/-11-/, ' November ');
  var P_Date = P_Date.replace(/-12-/, ' December ');
 
  var P_Date = P_Date.replace(/(.*) (.*) (.*)/, '$3 $2 $1');
 
  return P_Date;
};
function f_process_DateUS(P_Date) {
 
  var P_Date = P_Date.replace(/^1\//, ' January ');
  var P_Date = P_Date.replace(/^2\//, ' February ');
  var P_Date = P_Date.replace(/^3\//, ' March ');
  var P_Date = P_Date.replace(/^4\//, ' April ');
  var P_Date = P_Date.replace(/^5\//, ' May ');
  var P_Date = P_Date.replace(/^6\//, ' June ');
  var P_Date = P_Date.replace(/^7\//, ' July ');
  var P_Date = P_Date.replace(/^8\//, ' August ');
  var P_Date = P_Date.replace(/^9\//, ' September ');
  var P_Date = P_Date.replace(/^10\//, ' October ');
  var P_Date = P_Date.replace(/^11\//, ' November ');
  var P_Date = P_Date.replace(/^12\//, ' December ');
 
  var P_Date = P_Date.replace(/\//, ', ');
 
  return P_Date;
};
function f_process_DateUS_to_DateYMD(P_Date) {
 
  var P_Date = P_Date.replace(/^(.) /, '0$1 ');
 
  var P_Date = P_Date.replace(/,/, '');
  var P_Date = P_Date.replace(/1st/, '1');
  var P_Date = P_Date.replace(/2nd/, '2');
  var P_Date = P_Date.replace(/([0-9])rd/, '$1');
 
  var P_Date = P_Date.replace(/January /, '01 ');
  var P_Date = P_Date.replace(/February /, '02 ');
  var P_Date = P_Date.replace(/March /, '03 ');
  var P_Date = P_Date.replace(/April /, '04 ');
  var P_Date = P_Date.replace(/May /, '05 ');
  var P_Date = P_Date.replace(/June /, '06 ');
  var P_Date = P_Date.replace(/July /, '07 ');
  var P_Date = P_Date.replace(/August /, '08 ');
  var P_Date = P_Date.replace(/September /, '09 ');
  var P_Date = P_Date.replace(/October /, '10 ');
  var P_Date = P_Date.replace(/November /, '11 ');
  var P_Date = P_Date.replace(/December /, '12 ');
 
  var P_Date = P_Date.replace(/(.*) (.*) (.*)/, '$3-$1-$2');
  var P_Date = P_Date.replace(/(.*)-(.*)-([0-9])$/, '$1-$2-0$3');
 
  return P_Date;
};
function f_process_EN_DateMMDDYYYY(P_Date) {
 
  var P_Date = P_Date.replace(/\//, ' ');
  var P_Date = P_Date.replace(/\//, ', ');
 
  var P_Date = P_Date.replace(/^01 /, 'January ');
  var P_Date = P_Date.replace(/^02 /, 'February ');
  var P_Date = P_Date.replace(/^03 /, 'March ');
  var P_Date = P_Date.replace(/^04 /, 'April ');
  var P_Date = P_Date.replace(/^05 /, 'May ');
  var P_Date = P_Date.replace(/^06 /, 'June ');
  var P_Date = P_Date.replace(/^07 /, 'July ');
  var P_Date = P_Date.replace(/^08 /, 'August ');
  var P_Date = P_Date.replace(/^09 /, 'September ');
  var P_Date = P_Date.replace(/^10 /, 'October ');
  var P_Date = P_Date.replace(/^11 /, 'November ');
  var P_Date = P_Date.replace(/^12 /, 'December ');
 
  return P_Date;
};
function f_remove_weekday_from_EN_Date(P_Date) {
 
  var P_Date = P_Date.replace(/\s*Monday,? */, '');
  var P_Date = P_Date.replace(/\s*Tuesday,? */, '');
  var P_Date = P_Date.replace(/\s*Wednesday,? */, '');
  var P_Date = P_Date.replace(/\s*Thursday,? */, '');
  var P_Date = P_Date.replace(/\s*Friday,? */, '');
  var P_Date = P_Date.replace(/\s*Saturday,? */, '');
  var P_Date = P_Date.replace(/\s*Sunday,? */, '');
 
  return P_Date;
};
function f_remove_suffix_from_day_of_month(P_Date) {
 
  var P_Date = P_Date.replace(/([0-9])th /, '$1 ');
  var P_Date = P_Date.replace(/3rd /, '3 ');
  var P_Date = P_Date.replace(/2nd /, '2 ');
  var P_Date = P_Date.replace(/1st /, '1 ');
 
  return P_Date;
};
function f_process_Authors_names(P_Authors) {
 
  var P_Authors = P_Authors.replace(/Globe Staff/, '')
  .replace(/Mirror.co.uk/, '')
  .replace(/\./g, '. ')
  .replace(/\n/g, '')
  .replace(/\t/g, '')
  .replace(/ +,/g, ',')
  .replace(/,/g, ', ')
  .replace(/  +/g, ' ')
  .replace(/^ +/, '')
  .replace(/ +$/, '')
  .replace(/^ +$/, '')
  .replace(/-/g, ' = ');
  if (AuthorNameTitleCase.match(/yes/i)){
      P_Authors = toTitleCase(P_Authors)
  }
  var P_Authors = P_Authors.replace(/ = /g, '-')
  .replace(/- /, '-')
  .replace(/, *$/, '')
  .replace(/ And /, ' and ')
  .replace(/^\s*By /i, '');
 
  if (P_Authors=='Zdnet') var P_Authors = '';
 
  return P_Authors;
};
function f_Newspaper_Name_Short(P_Newspaper) {
 
  if (P_Newspaper=='The New York Times') var P_Newspaper = 'NYT';
  if (P_Newspaper=='The Huffington Post') var P_Newspaper = 'HuPo';
  if (P_Newspaper=='The Huffington Post Canada') var P_Newspaper = 'HuPoCa' ;
  if (P_Newspaper=='YouTube') var P_Newspaper = 'YoTu';
  if (P_Newspaper=='The Washington Post') var P_Newspaper = 'TWP';
  if (P_Newspaper=='The Times of India') var P_Newspaper = 'TOI';
  if (P_Newspaper=='The Boston Globe') var P_Newspaper = 'BoGlo';
  if (P_Newspaper=='Daily Mirror') var P_Newspaper = 'DaMi';
  if (P_Newspaper=='The Daily Telegraph') var P_Newspaper = 'DaTe';
  if (P_Newspaper=='BusinessWeek') var P_Newspaper = 'BuWe';
  if (P_Newspaper=='Financial Times') var P_Newspaper = 'FiTi';
  if (P_Newspaper=='The Economist') var P_Newspaper = 'ThEc';
  if (P_Newspaper=='Ars Technica') var P_Newspaper='ArsTe';
  if (P_Newspaper=='TG Daily') var P_Newspaper = 'TGD';
  if (P_Newspaper=='The Wall Street Journal') var P_Newspaper = 'WSJ';
  if (P_Newspaper=='The Guardian') var P_Newspaper = 'Guard';
  if (P_Newspaper=='The Independent') var P_Newspaper = 'Indep';
  if (P_Newspaper=='The Register') var P_Newspaper = 'Reg';
 
  return P_Newspaper;
};
var u = document.URL;
var d = document.body.innerHTML;
var W_Authors = '';
var W_Date = '';
var W_DateUK = '';
var W_Title = '';
var W_Newspaper = '';
var W_Source = '';
var sItalic = '\'\'';
var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
var today = new Date();
var month_today = months[today.getMonth()];
var dd = today.getDate();
var mm = today.getMonth()+1;
var yyyy = today.getFullYear();
var zdd = dd;
if (zdd<10) { var zdd='0'+zdd };
if (mm<10) { var mm='0'+mm };
var today = zdd+'.'+mm+'.'+yyyy;
var today_YMD = yyyy+'-'+mm+'-'+zdd;
var today_EN = yyyy+'-'+mm+'-'+zdd;
var UStoday_EN = month_today + ' ' + dd + ', '+yyyy;
var UKtoday_EN = dd + ' ' + month_today + ' '+ yyyy;
var yesterday = new Date(new Date().setDate(new Date().getDate()-1));
var month_yesterday = months[yesterday.getMonth()];
var ydd = yesterday.getDate();
var zydd = ydd;
var ymm = yesterday.getMonth()+1;
var yyyyy = yesterday.getFullYear();
if (zydd<10) { var zydd='0'+ydd };
if (ymm<10) { var ymm='0'+ymm };
var yesterday = zydd+'.'+ymm+'.'+yyyyy;
var yesterday_YMD = yyyyy+'.'+ymm+'.'+zydd;
var yesterday_EN = yyyyy+'-'+ymm+'-'+zydd;
var USyesterday_EN = month_yesterday + ' ' + ydd + ', ' + yyyyy;
var UKyesterday_EN = ydd + ' ' + month_yesterday + ' ' + yyyyy;
if (Date_Format == 'US') { var today_EN = UStoday_EN; var yesterday_EN = USyesterday_EN; };
if (Date_Format == 'UK') { var today_EN = UKtoday_EN; var yesterday_EN = UKyesterday_EN; };
if (Date_Format == 'YMD') { var today_EN = today_YMD; var yesterday_EN = yesterday_YMD; };
var WW_Title = f_process_Title(document.title);
var WW_Title = WW_Title.replace(/ *\|.*/, '');
var WW_Newspaper = f_process_Newspaper_Name();
var W_URL = document.URL;
var Article_Date_Format = 'US';
   var comment = 'Article_Date_Format tells us in which format we get the publication date (US or UK), so we know how to generate the other formats';
var dq = String.fromCharCode(34);
if ((u.match(/bbc.co.uk/))||(u.match(/bbc.com/))) {
  var x = document.title;
  var x = x.replace(/BBC NEWS \| Europe \| /,'');
  var x = x.replace(/.*\| */,'');
   var W_Title = x.replace(/BBC News - /,'');
  if (d.match(/<span class=.date.>/)) {
    var example = 'http://www.bbc.com/news/science-environment-20890389';
    var x = d.match(/<span class=.date.>.*/)[0];
    var x = x.replace(/<span class=.date.>\s*/, '');
     var W_DateUK = x.replace(/\s*<\/span>.*/, '');
 } else
  if (d.match(/<p class=.date/)) {
    var example = 'http://www.bbc.com/news/science-environment-26878529';
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<\/p>/g, '<\/p>\n');
    var x = x.replace(/<p([> ])/g, '\n<p$1');
    var x = x.match(/<p class=.date.*/)[0];
    var x = x.replace(/\s*<\/strong>.*/, '');
    var W_DateUK = x.replace(/.*>\s*/, '');
 } else
  if (d.match(/<span class=.ds./)) {
    var example = 'http://news.bbc.co.uk/2/hi/business/2774481.stm';
    var x = d.match(/<span class=.ds..*/)[0];
    var x = x.replace(/\s*<\/span>.*/, '');
    var W_DateUK = x.replace(/.*>\s*/, '');
  } else
  if (d.match(/<span class=.lu.>.*/)) {
    var x = d.match(/<span class=.lu.>.*/)[0];
    var x = x.replace(/<span class=.lu.>Last Updated: <\/span>/,'');
    var x = x.replace(/GMT.*/, '');
    var x = x.replace(/:.*/, '');
    var x = x.replace(/,/, '@');
    var x = x.replace(/.*@/, '');
     var W_DateUK = x.replace(/,.*/, '');
  };
  if (d.match(/<span class=.byl.>/)) {
    var x = d.match(/<span class=.byl.>[^]*<\/span>/)[0];
    var x = W_Authors.match(/By .*/)[0];
  } else
  if (d.match(/<span class=.byline-name.>/)) {
    var x = d.match(/<span class=.byline-name.>.*<\/span>/)[0];
    var x = x.replace(/<span class=.byline-name.>/, '');
     var W_Authors = x.replace(/<\/span>/, '');
  };
   var W_DateUK = W_DateUK.replace(/,/g, '');
   var Article_Date_Format = 'UK';
   var W_Newspaper = 'BBC';
};
if (u.match(/dailymail.co.uk/)) {
  if (d.match(/<h1>.*/)) {
    var x = d.match(/<h1>.*<\/h1>/)[0];
    var x = x.replace(/<.?h1>/g, '');
    var x = x.replace(/<br>/g, '');
     var W_Title = x.replace(/ \| Mail Online/, '');
  };
  var x = d.replace(/[\r\n]/g,'');
  var x = x.replace(/<\/p>/g, '<\/p>\n');
  var x = x.replace(/<div/g, '\n<div');
  var x = x.replace(/<p([> ])/g, '\n<p$1');
  if (x.match(/published:/i)) {
    var x = x.match(/published:.*/i)[0];
    var x = x.replace(/<\/span>/, '/<\/spam>');
    var x = x.replace(/\s*<\/span>.*/, '');
    var x = x.replace(/.*>\s*/, '');
     var W_DateUK = x.replace(/.*,/, '');
  } else
  if (x.match(/updated:/i)) {
    var x = x.match(/updated:.*/i)[0];
    var x = x.replace(/<\/span>/, '/<\/spam>');
    var x = x.replace(/\s*<\/span>.*/, '');
    var x = x.replace(/.*>\s*/, '');
     var W_DateUK = x.replace(/.*,/, '');
  };
  if (d.match(/class=.author. rel=.nofollow./)) {
    var xa = d.match(/class=.author. rel=.nofollow..*/g);
    for (i=0; i<xa.length; i++) {
      var x = xa[i].replace(/\s*<\/a>.*/, '');
      if (i>0) var W_Authors = W_Authors + ',';
       var W_Authors = W_Authors + x.replace(/.*>/, '');
    };
  };
   var Article_Date_Format = 'UK';
   var W_Newspaper = 'Daily Mail';
};
if (u.match(/arstechnica.com/)) {
  var x = document.title;
   var W_Title = x.replace(/ *\| *Ars Technica/, '');
  if (d.match(/ class=.date./)) {
    var x = d.match(/ class=.date..*/)[0];
    var x = x.replace(/\s*<\/span>.*/, '');
     var W_Date = x.replace(/.*>\s*/, '');
  };
  if (d.match(/<a href=.*rel=.author./)) {
    var x = d.match(/ <a href=.*rel=.author..*/)[0];
    var x = x.replace(/<\/a>.*/, '');
     var W_Authors = x.replace(/.*>/, '');
  } else
  if (d.match(/class=.author-name./)) {
    var x = d.match(/class=.author-name..*/)[0];
    var x = x.replace(/<\/a>.*/, '');
     var W_Authors = x.replace(/.*>/, '');
  } else
  if (d.match(/class=.author./)) {
    var x = d.match(/class=.author..*/)[0];
    var x = x.replace(/<\/span>.*/, '');
     var W_Authors = x.replace(/.*>/, '');
  };
   var W_Newspaper = 'Ars Technica';
};
if (u.match(/tgdaily.com/)) {
  var x = document.title;
  var x = x.replace(/ \| TG Daily/, '');
   var W_Title = x.replace(/ – DIY Tech - TG Daily/, '');
  if (d.match(/<time datetime/)) {
    var x = d.match(/<time datetime.*/)[0];
    var x = x.replace(/<\/time>.*/, '');
    var x = x.replace(/.*>/, '');
     var W_Date = x.replace(/ - .*/, '');
     var W_Date = f_process_EN_DateMMDDYYYY(W_Date);
  };
  var x = d.replace(/[\r\n]/g,'');
  var x = x.replace(/<\/div>/g,'<\/div>\n');
  if (x.match(/<span itemprop=.author/)) {
    var x = x.match(/<span itemprop=.author.*/)[0];
    var x = x.replace(/\s*<\/span>.*/, '');
    var x = x.replace(/\s*<\/a>.*/, '');
    var x = x.replace(/.*>\s*by\s*/, '');
     var W_Authors = x.replace(/.*>/, '');
  };
 var W_Newspaper = 'TG Daily';
};
if (u.match(/businessweek.com/)) {
  var x = document.title;
   var W_Title = x.replace(/ - Businessweek/i, '');
  var x = d.replace(/[\r\n]/g,'');
  var x = x.replace(/<time/g, '\n<time');
  var x = x.replace(/<\/time>/g, '<\/time>\n');
  if (x.match(/<time /)) {
    var x = x.match(/<time .*/)[0];
    var x = x.replace(/\s*<\/time>.*/, '');
     var W_Date = x.replace(/.*>\s*/, '');
  } else
  if (d.match(/<span class=.publication_date.>/)) {
    var x = d.match(/<span class=.publication_date.>.*/)[0];
    var x = x.replace(/<span class=.publication_date.>/, '');
     var W_Date = x.replace(/<.*/, '');
  } else
  if (d.match(/<span class=.date.>/)) {
    var x = d.match(/<span class=.date.>.*/)[0];
    var x = x.replace(/\s*<\/span>.*/, '');
     var W_Date = x.replace(/.*>/, '');
  } else
  if (d.match(/<h2>/)) {
    var x = d.match(/<h2>.*/)[0];
    var x = x.replace(/\s*<\/h2>.*/, '');
    var x = x.replace(/.*>/, '');
    var x = x.replace(/Posted by: /, '');
     var W_Date = x.replace(/(.*) on (.*)/, '$2, $1');
  };
  var x = d.replace(/[\r\n]/g,'');
  var x = x.replace(/<span/g, '\n<span');
  var x = x.replace(/<\/span>/g, '<\/span>\n');
  if (x.match(/byline-text/)) {
    var x = x.match(/byline-text.*/)[0];
    var x = x.replace(/\s*<\/span>.*/, '');
    var x = x.replace(/<\/a>/g, '<\/a>\n');
    var x = x.replace(/\s*<\/a>.*/g, '');
    var x = x.replace(/.*>\s*/g, '');
    var x = x.replace(/^By /i, '');
    var x = x.replace(/\n/g, ', ');
     var W_Authors = x.replace(/and /, ',');
  };
 var W_Newspaper = 'BusinessWeek';
};
if (u.match(/ft.com/)) {
  var x = document.title;
   var W_Title = x.replace(/ - FT.com/i, '');
  if (d.match(/<span class=.time/)) {
    var x = d.match(/<span class=.time.*/)[0];
    var x = x.replace(/\s*<\/span>.*/, '');
     var W_Date = x.replace(/.*>\s*/, '');
  } else
  if (d.match(/<span class=.*entry-date.>/)) {
    var x = d.match(/<span class=.*entry-date.>.*/)[0];
    var x = x.replace(/\s*<\/span>.*/, '');
     var W_Date = x.replace(/.*>\s*/, '');
  } else
  if (d.match(/<time /)) {
    var x = d.match(/<time .*/)[0];
    var x = x.replace(/\s*<\/time>.*/, '');
     var W_Date = x.replace(/.*>\s*/, '');
  };
  var x = d.replace(/[\r\n]/g,'');
  var x = x.replace(/<\/p>/g, '<\/p>\n');
  var x = x.replace(/<p([> ])/g, '\n<p$1');
  if (x.match(/class=.byline/)) {
    var x = x.match(/class=.byline.*/)[0];
    var x = x.replace(/\s*<\/span>.*/, '');
    var x = x.replace(/.*>\s*/, '');
    var x = x.replace(/^By /i, '');
     var W_Authors = x.replace(/and /, ',');
  } else
  if (x.match(/class=.author_byline/)) {
    var x = x.match(/class=.author_byline.*/)[0];
    var x = x.replace(/\s*<\/a>.*/, '');
    var x = x.replace(/.*>\s*/, '');
    var x = x.replace(/^By /i, '');
     var W_Authors = x.replace(/and /, ',');
  };
 var W_Newspaper = 'Financial Times';
};
if (u.match(/economist.com/)) {
  var x = document.title;
   var W_Title = x.replace(/ \| The Economist/i, '');
  if (d.match(/<time /)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<\/time>/g, '<\/time>\n');
    var x = x.replace(/<time/g, '\n<time');
    var x = x.match(/<time .*/)[0];
    var x = x.replace(/\s*<\/time>.*/, '');
    var x = x.replace(/.*>\s*/, '');
     var W_Date = f_remove_suffix_from_day_of_month(x);
 var comment = 'The Economist doesn\'t add a comma (,) into publication date';
    if (!(W_Date.match(/,/))) var W_Date = W_Date.replace(/(.*) (.*) (.*)/, '$1 $2, $3');
  };
 var W_Newspaper = 'The Economist';
};
if (u.match(/nytimes.com/)) {
  var x = document.title;
  var x = x.replace(/ - NYTimes.com/i, '');
  var x = x.replace(/ - New York Times/i, '');
   var W_Title = x.replace(/ - The New York Times/i, '');
  if (d.match(/class=.dateline. datetime/)) {
    var x = d.match(/class=.dateline.*/)[0];
    var x = x.replace(/\s*<\/time>.*/, '');
     var W_Date = x.replace(/.*>\s*/, '');
  } else
  if (d.match(/class=.dateline./)) {
    var x = d.match(/class=.dateline.*/)[0];
    var x = x.replace(/.*class=.dateline.>\s*/, '');
     var W_Date = x.replace(/\s*<.*/, '');
  } else
  if (d.match(/class=.timestamp./)) {
    var x = d.match(/class=.timestamp.*/)[0];
    var x = x.replace(/.*class=.timestamp.>\s*/, '');
     var W_Date = x.replace(/\s*<.*/, '');
  } else
  if (d.match(/id=.mod-article-byline/)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<div/g, '\n<div');
    var x = x.replace(/<\/div>/g, '<\/div>\n');
    var x = d.match(/id=.mod-article-byline.*/i)[0];
    var x = x.replace(/\s*<\/div>.*/, '');
     var W_Date = x.replace(/.*>\s*/, '');
};
  if (d.match(/<span itemprop=.author creator/)) {
    var x = d.match(/<span itemprop=.author creator.*/)[0];
    var x = x.replace(/\s*<\/span>.*/, '');
     var W_Authors = x.replace(/.*>\s*/, '');
  } else
  if (d.match(/class=.byline author./)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<address/g, '\n<address');
    var x = x.replace(/<div/g, '\n<div');
    var x = x.replace(/<\/a>/g, '<\/a>\n');
    var x = x.match(/class=.byline author.*/)[0];
    var x = x.replace(/\s*<\/a>.*/, '');
    var x = x.replace(/.*>\s*/, '');
     var W_Authors = x.replace(/^\s*By /i, '');
  } else
  if (d.match(/class=.byline./)) {
    var x = d.match(/class=.byline.*/)[0];
    var x = x.replace(/\s*<\/div>.*/, '');
    var x = x.replace(/.*>\s*/, '');
     var W_Authors = x.replace(/^By /i, '');
  } else
  if (d.match(/id=.mod-article-byline./)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<div/g, '\n<div');
    var x = x.replace(/<\/div>/g, '<\/div>\n');
    var x = x.match(/id=.mod-article-byline.*/)[0];
    var x = x.replace(/.*id=.mod-article-byline.>/, '');
     var W_Authors = x.replace(/\s*<.*/, '');
  };
 var W_Newspaper = 'The New York Times';
};
if (u.match(/huffingtonpost.com/)) {
  var x = document.title;
   var W_Title = x;
  if (d.match(/<span class=.updated./)) {
    var x = d.match(/<span class=.updated..*/)[0];
    var x = x.replace(/<\/span>.*/, '');
     var W_Date = x.replace(/.*>/, '');
  };
  if (d.match(/itemprop=.datePublished./)) {
    var x = d.match(/itemprop=.datePublished..*/)[0];
    var x = x.replace(/itemprop=.datePublished.> */,'');
     var W_Date = x.replace(/<.*/, '');
  };
  if (d.match(/class=.arial_11.*Posted:/)) {
    var x = d.match(/class=.arial_11.*Posted:.*/)[0];
    var x = x.replace(/.*Posted: */,'');
     var W_Date = x.replace(/<.*/, '');
  };
  if (d.match(/Posted: <time datetime/)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<\/time>/g,'<\/time>\n');
    var x = x.replace(/<span>/g,'\n<span>');
    var x = x.match(/Posted: <time datetime.*/)[0];
    var x = x.replace(/\s*<\/time>.*/,'');
    var x = x.replace(/.*>\s*/, '');
     var W_Date = x.replace(/\s*\w*:.*$/, '');
 };
  var x = d.replace(/[\r\n]/g,'');
  var x = x.replace(/<\/div>/g,'<\/div>\n');
  var x = x.replace(/<\/p>/g,'<\/p>\n');
  if (W_Date=='')
  if (x.match(/<span class=.bold color/)) {
    var x = x.match(/<span class=.bold color.*/)[0];
    var x = x.replace(/rel=.author.>/, '');
    var x = x.replace(/<\/span>/g, '<\/span>\n');
    var x1 = x.match(/<span class=.bold color.*/)[0];
    var x1 = x1.replace(/\s*<\/span>.*/,'');
     var W_Authors = x1.replace(/.*>By /, '');
    var x = x.replace(/\s*<span class=.bold color.*/,'');
    var x = x.replace(/[\r\n]/g,'');
    var x = x.replace(/\s*<span.*/,'');
     var W_Date = x.replace(/^\s*/,'');
  };
  if (d.match(/<span class=.author vcard.>/)) {
    var x = d.match(/<span class=.author vcard.>.*/)[0];
    var x = x.replace(/<\/a>.*/, '');
     var W_Authors = x.replace(/.*>/, '');
  };
  if (d.match(/rel=.author.>/)) {
    var x = d.match(/rel=.author.>.*/)[0];
    var x = x.replace(/rel=.author.>/, '');
     var W_Authors = x.replace(/<\/a>.*/, '');
  };
  if (d.match(/span class=.name fn/)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<\/span>/g, '<\/span>\n');
    var x = x.replace(/<span/g, '\n<span');
    var x = x.match(/span class=.name fn.*/)[0];
    var x = x.replace(/.*By\s*/, '');
     var W_Authors = x.replace(/\s*<\/span>.*/, '');
  };
  if (W_Authors=='') {
    if (W_Title.match(/\|/)) {
      var W_Authors = W_Title.replace(/.*\|\s*/, '');
      var W_Title = W_Title.replace(/ *\|.*/, '');
    };
  };
  if (W_Date.match(/\//)) {
    var W_Date = W_Date.replace(/(.*)\/(.*)\/(.*)/, '$3-$1-$2');
    if (W_Date.match(/^(..)-(.*)-(.*)/)) var W_Date = W_Date.replace(/^/, '20');
    var W_DateUK = f_process_DateYMD_to_DateUK(W_Date);
    var Article_Date_Format = 'UK';
  };
   var W_Newspaper = 'The Huffington Post';
};
if (u.match(/huffingtonpost.ca/)) {
  var x = document.title;
   var W_Title = x.replace(/\|.*/, '');
  if (d.match(/itemprop=.datePublished./)) {
    var x = d.match(/itemprop=.datePublished..*/)[0];
    var W_Date = x.replace(/itemprop=.datePublished.> */,'');
  } else
  if (d.match(/class=.arial_11.*Posted:/)) {
    var x = d.match(/class=.arial_11.*Posted:.*/)[0];
    var x = x.replace(/.*Posted: */,'');
     var W_Date = x.replace(/<.*/, '');
  } else
  if (d.match(/First Posted: /)) {
    var x = d.match(/First Posted: .*/)[0];
    var x = x.replace(/.*First Posted: */,'');
     var W_Date = x.replace(/\s*<.*/, '');
  };
  if (d.match(/rel=.author.>/)) {
    var x = d.match(/rel=.author.>.*/)[0];
    var x = x.replace(/rel=.author.>/, '');
     var W_Authors = x.replace(/<\/a>.*/, '');
  };
   if (W_Date.match(/\//)) {
     var W_Date = W_Date.replace(/(.*)\/(.*)\/(.*)/, '$3-$1-$2');
     if (W_Date.match(/^(..)-(.*)-(.*)/)) var W_Date = W_Date.replace(/^/, '20');
     var W_DateUK = f_process_DateYMD_to_DateUK(W_Date);
     var Article_Date_Format = 'UK';
   };
   var W_Newspaper = 'The Huffington Post Canada';
};
if (u.match(/youtube.com/)) {
  var x = document.title;
   var W_Title = x.replace(/ - YouTube/, '');
  if (d.match(/class=.watch-video-date./)) {
    var x = d.match(/class=.watch-video-date..*/)[0];
    var x = x.replace(/<\/span>.*/, '');
     var W_Date = x.replace(/.*>/, '');
     var W_DateUK = W_Date;
  };
  if (d.match(/link itemprop=.url..*user\//)) {
    var x = d.match(/link itemprop=.url..*user\/.*/)[0];
    var x = x.replace(new RegExp(dq + '>.*'), '');
    var x = x.replace(new RegExp('.*' + dq), '');
     var W_Authors = x.replace(/.*user\//, '');
     var AuthorNameTitleCase = 'no';
  };
   var W_Newspaper = 'YouTube';
};
if (u.match(/washingtonpost.com/)) {
  var x = document.title;
   var x = x.replace(/ - washingtonpost.com/, '');
   var x = x.replace(/ - The Washington Post/, '');
   var W_Title = x.replace(/ \(washingtonpost.com\)/, '');
  var d = d.replace(/<.-*>/g,'');
  var x = d.replace(/[\r\n]/g,'');
  var x = x.replace(/<div/g, '\n<div');
  var x = x.replace(/<p>/g, '<p>\n');
  if (d.match(/id=.byline./)) {
    var x = x.match(/id=.byline.*/)[0];
    var x = x.replace(/\s*<\/p>.*/i, '');
    var x = x.replace(/<\/font>/, '<\/fonx>');
    if (!(x.match(/<\/font>/))) var x = x.replace(/\s*<\/fonx>.*/i, '');
    var x = x.replace(/\s*<\/font>.*/i, '');
     var W_Date = x.replace(/.*>\s*/, '');
  } else
  if (d.match(/START DATE AND PAGE/i)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/START DATE AND PAGE/g, '\nSTART DATE AND PAGE');
    var x = x.replace(/END DATE AND PAGE/g, '\nEND DATE AND PAGE');
    var x = x.match(/START DATE AND PAGE.*/)[0];
    var x = x.replace(/START DATE AND PAGE NUMBER HERE -*>/i, '');
     var W_Date = x.replace(/\s*<.*/i, '');
  } else
  if (d.match(/plsfield:disp_date/)) {
    var x = d.match(/plsfield:disp_date.*/)[0];
    var x = x.replace(/.*>\s*/, '');
    var W_Date = x.replace(/;.*/, '');
  } else
  if (d.match(/<FONT SIZE=/i)) {
    var x = x.match(/<FONT SIZE=.*/i)[0];
    var x = x.replace(/\s*<\/p>.*/i, '');
    var x = x.replace(/\s*<\/font>.*/i, '');
     var W_Date = x.replace(/.*>\s*/, '');
  } else
  if (d.match(/<time datetime/)) {
    var x = d.match(/<time datetime.*/)[0];
    var x = x.replace(/\s*<\/time>.*/i, '');
    var x = x.replace(/.*>\s*/, '');
    var x = x.replace(/;.*/, '');
     var W_Date = x.replace(/ at .*/, '');
  } else
  if (d.match(/pubdate:/)) {
    var x = d.match(/pubdate:.*/)[0];
    var x = x.replace(/.*pubdate:\s*/, '');
    var x = x.replace(/\s.*/, '');
     var W_Date = f_remove_weekday_from_EN_Date(x);
  };
  if (d.match(/id=.byline./)) {
    var x = d.match(/id=.byline.*/)[0];
    var x = x.replace(/\s*<\/div.*/, '');
    var x = x.replace(/\s*<\/font.*/, '');
    var x = x.replace(/.*>\s*by\s*/i, '');
     var W_Authors = x.replace(/.*>/, '');
  } else
  if (d.match(/START BYLINE HERE/i)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/START BYLINE HERE/g, '\nSTART BYLINE HERE');
    var x = x.replace(/END BYLINE HERE/g, '\nEND BYLINE HERE');
    var x = x.match(/START BYLINE HERE.*/)[0];
    var x = x.replace(/START BYLINE HERE -*>/i, '');
    var x = x.replace(/\s*<.*/i, '');
     var W_Authors = x.replace(/\s*By /i, '');
  } else
  if (d.match(/plsfield:byline/)) {
    var x = d.match(/plsfield:byline.*/)[0];
    var x = x.replace(/\s*<\/i.*/i, '');
    var x = x.replace(/.*>\s*by\s*/i, '');
     var W_Authors = x.replace(/.*>/, '');
  } else
  if (d.match(/class=.author./)) {
    var x = d.match(/class=.author..*/)[0];
    var x = x.replace(/\s*<\/a>.*/i, '');
    var x = x.replace(/.*>\s*/, '');
     var W_Authors = x.replace(/\s*by */i, '');
  } else
  if (d.match(/class=.byline/)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<h6/g, '\n<h6');
    var x = x.replace(/<\/h6>/g, '<\/h6>\n');
    var x = x.match(/class=.byline.*/)[0];
    var x = x.replace(/\s*<\/a>.*/i, '');
    var x = x.replace(/.*>\s*/, '');
     var W_Authors = x.replace(/\s*by */i, '');
  };
 var W_Newspaper = 'The Washington Post';
};
if (u.match(/wsj.com/)) {
  var x = document.title;
   var W_Title = x.replace(/ - WSJ/, '');
  if (d.match(/<div class=.module datestamp/)) {
    var x = d.match(/<div class=.module datestamp.*/)[0];
    var x = x.replace(/\s*<\/div>.*/, '');
     var W_Date = x.replace(/.*>/, '');
  } else
  if (d.match(/<li class=.dateStamp first/)) {
    var x = d.match(/<li class=.dateStamp first.*/)[0];
    var x = x.replace(/\s*<\/small>.*/, '');
     var W_Date = x.replace(/.*>/, '');
  } else
  if (d.match(/<small class=.post-time/)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<\/small>/g, '<\/small>\n');
    var x = x.replace(/<small/g, '\n<small');
    var x = x.match(/<small class=.post-time.*/)[0];
    var x = x.replace(/\s*<\/small>.*/, '');
     var W_Date = x.replace(/.*>/, '');
  };
  if (d.match(/<span class=.c-name/)) {
    var x = d.match(/<span class=.c-name.*/)[0];
    var x = x.replace(/\s*<\/span>.*/, '');
    var x = x.replace(/<span class=.bk-box.*/, '');
     var W_Authors = x.replace(/.*>/, '');
  };
  if (d.match(/<\!-- author(s) --><li>By /)) {
    var x = d.match(/<\!-- author(s) --><li>By .*/)[0];
    var x = x.replace(/\s*<\/a>.*/, '');
     var W_Authors = x.replace(/.*>/, '');
  };
  if (d.match(/<\!-- author\(s\) --><li>By /)) {
    var x = d.match(/<\!-- author\(s\) --><li>By .*/)[0];
    var x = x.replace(/\s*<\/a>.*/, '');
     var W_Authors = x.replace(/.*>/, '');
  };
 var W_Newspaper = 'The Wall Street Journal';
};
if (u.match(/timesofindia.indiatimes.com/)) {
  var x = document.title;
   var W_Title = x.replace(/ - The Times of India/, '');
  if (d.match(/iBeat_articledt/)) {
    var x = d.match(/iBeat_articledt.*/)[0];
    var x = x.replace(/iBeat_articledt=./,'');
    var x = x.replace(/,/,';');
    var x = x.replace(/,.*/,'');
    var W_Date = x.replace(/;/,',');
  } else
  if (d.match(/<span style=.font-size:9/)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<span /g, '\n<span ');
    var x = x.replace(/<\/span><div/g, '<\/span><div\n');
    var x = x.match(/<span style=.font-size:9.*/)[0];
    var x = x.replace(/\s*<\/span><div.*/,'');
    var x = x.replace(/.*>\s*/,'');
    var x = x.replace(/,/,';');
    var x = x.replace(/,.*/,'');
     var W_Date = x.replace(/;/,',');
  };
  if (d.match(/iBeat_author/)) {
    var x = d.match(/iBeat_author.*/)[0];
    var x = x.replace(/iBeat_author=./,'');
     var W_Authors = x.replace(new RegExp(dq + '.*'), '');
  } else
  if (d.match(/<a rel=.author./)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<a /g, '\n<a ');
    var x = x.replace(/<\/a>/g, '<\/a>\n');
    var x = x.match(/<a rel=.author.*/)[0];
    var x = x.replace(/\s*<\/a>.*/,'');
     var W_Authors = x.replace(/.*>\s*/,'');
  };
   var W_Newspaper = 'The Times of India';
};
if (u.match(/bostonglobe.com/)) {
  var x = document.title;
  var x = x.replace(/ - Metro - The Boston Globe/, '');
  var x = x.replace(/ - Ideas - The Boston Globe/, '');
  var x = x.replace(/ - Arts - The Boston Globe/, '');
   var W_Title = x.replace(/ - The Boston Globe/, '');
  var dd = d.replace(/[\r\n]/g,'');
  var dd = dd.replace(/<h2/g, '\n<h2');
  var dd = dd.replace(/<\/h2>/g, '<\/h2>\n');
  if (d.match(/web pub date/)) {
    var x = d.match(/web pub date.*/)[0];
    var x = x.replace(/.*web pub date /,'');
     var W_Date = x.replace(/ -.*/, '');
  };
  if (d.match(/class=.author./)) {
    var x = dd.match(/class=.author.*/)[0];
    var x = x.replace(/<\/?cite>/g, '');
    var x = x.replace(/\s*<\/h2>.*/, '');
    var x = x.replace(/<\/a>/g, '<\/a>\n');
    var x = x.replace(/\s*<\/a>.*/g, '');
    var x = x.replace(/.*>\s*/g, '');
    var x = x.replace(/\n/g, ', ');
     var W_Authors = x.replace(/^by /i, '');
  };
   var W_Newspaper = 'The Boston Globe';
};
if (u.match(/mirror.co.uk/)) {
  var x = document.title;
   var W_Title = x.replace(/ - Mirror Online/, '');
  if (d.match(/data-action=.archive/)) {
    var x = d.match(/data-action=.archive.*/)[0];
    var x = x.replace(/\s*<\/a>.*/,'');
     var W_Date = x.replace(/.*>\s*/,'');
  };
  if (d.match(/data-action=.author/)) {
    var x = d.match(/data-action=.author.*/)[0];
    var x = x.replace(/<\/em><em class=.boldFont.>/,' ');
    var x = x.replace(/\s*<\/a>.*/,'');
    var x = x.replace(/\s*<\/em>.*/,'');
    var x = x.replace(/\s*<\/li>.*/,'');
    var x = x.replace(/.*>\s*/,'');
     var W_Authors = x.replace(/^by /i, '');
  } else
  if (d.match(/class=.author/)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<li/g, '\n<li');
    var x = x.replace(/<\/li>/g, '<\/li>\n');
    var x = x.match(/class=.author.*/)[0];
    var x = x.replace(/<\!-*>/,'');
    var x = x.replace(/\s*<\/li>.*/,'');
    var x = x.replace(/\s*<\/span>.*/,'');
    var x = x.replace(/.*>\s*/,'');
     var W_Authors = x.replace(/^by /i, '');
  } else
  if (d.match(/<meta name=.author/)) {
    var x = d.match(/<meta name=.author.*/)[0];
    var x = x.replace(/.*content=./,'');
     var W_Authors = x.replace(new RegExp(dq + '.*'), '');
  };
   var W_Newspaper = 'Daily Mirror';
};
if (u.match(/telegraph.co.uk/)) {
  var x = document.title;
   var W_Title = x.replace(/ - Telegraph/, '');
  if (d.match(/class=.publishedDate/)) {
    var x = d.match(/class=.publishedDate.*/)[0];
    var x = x.replace(/\s*<\/p>.*/,'');
    var x = x.replace(/.*\s*GMT\s*/,'');
    var x = x.replace(/.*\s*BST\s*/,'');
     var W_DateUK = x.replace(/.*>\s*/,'');
  };
  if (d.match(/<span rel=.author/)) {
    var x = d.match(/<span rel=.author.*/)[0];
    var x = x.replace(/<\/em><em class=.boldFont.>/,' ');
    var x = x.replace(/\s*<\/span>.*/,'');
    var x = x.replace(/.*>\s*/,'');
     var W_Authors = x.replace(/^by /i, '');
  } else
  if (d.match(/itemprop=.author/)) {
    var x = d.match(/itemprop=.author.*/)[0];
    var x = x.replace(/\s*<\/p>.*/,'');
    var x = x.replace(/\s*<\/span>.*/,'');
    var x = x.replace(/.*>\s*/,'');
     var W_Authors = x.replace(/^by /i, '');
  };
   var Article_Date_Format = 'UK';
   var W_Newspaper = 'The Daily Telegraph';
};
if (u.match(/spiegel.de/)) {
  if (!(u.match(/spiegel.de\/international/))) var Article_Date_Format = 'UK';
  var x = document.title;
   var W_Title = x.replace(/ - SPIEGEL ONLINE/, '');
  if (d.match(/<time [^]*<\/time>/)) {
    var x = d.match(/<time [^]*<\/time>/)[0];
    var x = x.match(/.*<\/time>/)[0];
    var x = x.replace(/\s*<\/time>/,'');
    var x = x.replace(/\s*\&ndash;.*/,'');
    var x = x.replace(/\s*–.*/,'');
    if (Article_Date_Format == 'UK') var x = x.replace(/.*,\s*/,'');
     var W_Date = x.replace(/ *\w*:.*$/, '');
  } else
  if (d.match(/<span class=.short-date./)) {
    var x = d.match(/<span class=.short-date.*/)[0];
    var x = x.replace(/.*content=./,'');
    var x = x.replace(new RegExp(dq + '.*'), '');
    var x = x.replace(/T.*/,'');
     var W_Date = x.replace(/(.*)-(.*)-(.*)/, '$3.$2.$1');
  };
  if (Article_Date_Format == 'UK') var W_DateUK = W_Date;
  if (d.match(/<p class=.author.>/)) {
    var x = d.match(/<p class=.author.>.*/)[0];
    var x = x.replace(/<\/p>.*/,' ');
    var x = x.replace(/<\/a>.*/,' ');
    var x = x.replace(/.*>\s*By /,'');
     var W_Authors = x.replace(/.*>\s*/,'');
  };
   var W_Newspaper = 'Spiegel Online';
};
if (u.match(/cnn.com/)) {
  var x = document.title;
   var W_Title = x.replace(/ - CNN.com/, '');
  if (d.match(/<div class=.cnn_strytmstmp.>/)) {
    var x = d.match(/<div class=.cnn_strytmstmp.>.*/)[0];
    var x = x.replace(/\s*<\/div>.*/,'');
    var x = x.replace(/ -- .*/,'');
     var W_Date = x.replace(/.*>\s*/, '');
  };
  if (d.match(/<div class=.cnnByline.>/)) {
    var x = d.match(/<div class=.cnnByline.>.*/)[0];
    var x = x.replace(/,?<\/div>.*/,' ');
    var x = x.replace(/,?<\/strong>.*/,' ');
    var x = x.replace(/.*>\s*By /,'');
     var W_Authors = x.replace(/.*>\s*/,'');
  };
   var W_Newspaper = 'CNN';
};
if (u.match(/theguardian.com/)) {
  var x = document.title;
   var x = x.replace(/ \| theguardian.com/, '');
   var W_Title = x.replace(/ \| UK news/, '');
  if (d.match(/itemprop=.datePublished/)) {
    var x = d.match(/itemprop=.datePublished.*/)[0];
    var x = x.replace(/\s*<\/time>.*/,'');
     var W_DateUK = x.replace(/.*>\s*/, '');
    var W_DateUK = W_DateUK.replace(/,? *\w*\..*$/, '');
  };
  if (d.match(/ rel=.author./)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<\/span>/g, '<\/span>\n');
    var x = x.replace(/<span /g, '\n<span ');
    var xa = x.match(/ rel=.author.*/g);
    for (i=0; i<xa.length; i++) {
      var x = xa[i].replace(/\s*<\/a>.*/, '');
      var x = x.replace(/\s*<\/span>.*/, '');
      if (i>0) var W_Authors = W_Authors + ', ';
       var W_Authors = W_Authors + x.replace(/.*>/, '');
      };
  } else
  if (d.match(/<li class=.byline.>/)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<\/li>/g, '<\/li>\n');
    var x = x.replace(/<li /g, '\n<li ');
    var x = x.match(/<li class=.byline.>.*/)[0];
    var x = x.replace(/\s*<\/div>.*/,' ');
    var x = x.replace(/\s*<\/li>.*/,' ');
     var W_Authors = x.replace(/.*>\s*/,'');
  };
   var Article_Date_Format = 'UK';
   var W_Newspaper = 'The Guardian';
};
if (u.match(/independent.co.uk/)) {
  var x = document.title;
   var x = x.replace(/ - Business - News - The Independent/, '');
   var x = x.replace(/ - News - The Independent/, '');
   var x = x.replace(/ - Home News - UK/, '');
   var W_Title = x.replace(/ - The Independent/, '');
  if (d.match(/<p class=.dateline.>/)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<\/p>/g, '<\/p>\n');
    var x = x.replace(/<p /g, '\n<p ');
    var x = x.match(/<p class=.dateline.>.*/)[0];
    var x = x.replace(/\s*<\/p>.*/,'');
     var W_DateUK = x.replace(/.*>\s*/, '');
  };
  if (d.match(/<span class=.authorName.>/)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<\/span>/g, '<\/span>\n');
    var x = x.replace(/<span /g, '\n<span ');
    var x = x.match(/<span class=.authorName.>.*/)[0];
    var x = x.replace(/\s*<\/span>.*/,'');
     var W_Authors = x.replace(/.*>\s*/,'');
  };
   var Article_Date_Format = 'UK';
   var W_Newspaper = 'The Independent';
};
if (u.match(/theregister.co.uk/)) {
  var x = document.title;
   var W_Title = x.replace(/ • The Register/, '');
  if (d.match(/<span class=.dateline.>/)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<\/span>/g, '<\/span>\n');
    var x = x.replace(/<span /g, '\n<span ');
    var x = x.match(/<span class=.dateline.>.*/)[0];
    var x = x.replace(/\s*<\/span>.*/,'');
     var W_DateUK = x.replace(/.*>\s*/, '');
  };
  if (d.match(/<div class=.byline.>/)) {
    var x = d.replace(/[\r\n]/g,'');
    var x = x.replace(/<\/div>/g, '<\/div>\n');
    var x = x.replace(/<div /g, '\n<div ');
    var x = x.match(/<div class=.byline.>.*/)[0];
    var x = x.replace(/\s*<\/a>.*/,'');
    var x = x.replace(/\s*<span .*/,'');
     var W_Authors = x.replace(/.*>\s*/,'');
  };
   var Article_Date_Format = 'UK';
   var W_Newspaper = 'The Register';
};
if (u.match(/forbes.com/)) {
  var x = document.title;
   var W_Title = x.replace(/ - Forbes/, '');
  if (d.match(/<time itemprop=.datePublished./)) {
    var x = d.match(/<time itemprop=.datePublished.*/)[0];
    var x = x.replace(/\s*<\/time>.*/,'');
    var x = x.replace(/\s*@.*/,'');
    var W_Date = x.replace(/.*>\s*/, '');
  };
  if (d.match(/<span itemprop=.author.>/)) {
    var x = d.match(/<span itemprop=.author.>.*/)[0];
    var x = x.replace(/\s*<\/span>.*/,'');
     var W_Authors = x.replace(/.*>\s*/,'');
  };
   var Article_Date_Format = 'US';
   var W_Newspaper = 'Forbes';
};
if (u.match(/zdnet.com/)) {
  var x = document.title;
   var W_Title = x.replace(/ \| ZDNet/, '');
  if (d.match(/<time .* itemprop=.datePublished./)) {
    var x = d.match(/<time .* itemprop=.datePublished.*/)[0];
    var x = x.replace(/\s*<\/time>.*/,'');
    var x = x.replace(/\s*--.*/,'');
    var W_Date = x.replace(/.*>\s*/, '');
  };
  if (d.match(/<p class=.meta. itemprop=.author.>/)) {
    var x = d.match(/<p class=.meta. itemprop=.author.>.*/)[0];
    var x = x.replace(/\s*<\/p>.*/,'');
    var x = x.replace(/\s*<time>.*/,'');
    var x = x.replace(/\s*<\/a.*/,'');
    var x = x.replace(/\s*\|.*/,'');
    var x = x.replace(/ for <a.*/,'');
    var x = x.replace(/.*>\s*/,'');
     var W_Authors = x.replace(/^By /,'');
  };
   var Article_Date_Format = 'US';
   var W_Newspaper = 'ZDNet';
};
if (W_Title=='') var W_Title = WW_Title;
var W_Title = f_process_Title(W_Title);
if (W_Date.match(/today/i)) var W_Date = today_EN;
if (W_Date.match(/1 day ago/i)) var W_Date = yesterday_EN;
if (SiteLN == 'en') { var W_Date = f_process_EN_Date(W_Date); var W_DateUK = f_process_EN_Date(W_DateUK); };
if (Article_Date_Format=='UK') {
   var W_Date = W_DateUK.replace(/(.*) (.*) (.*)/, '$2 $1, $3');
   var W_Date_YMD = f_process_DateUK_to_DateYMD(W_DateUK);
} else {
   var W_Date = f_process_DateUS(W_Date);
    if (!(W_Date.match(/,/))) var W_Date = W_Date.replace(/(.*) (.*) (.*)/, '$1 $2, $3');
   var W_DateUK = W_Date.replace(/(.*) (.*), (.*)/, '$2 $1 $3');
   var W_Date_YMD = f_process_DateUS_to_DateYMD(W_Date);
};
var W_Subst_Date1 = '{{date|';
var W_Subst_Date2 = '|mdy}}';
if (Date_Format == 'YMD') { var W_Date = W_Date_YMD; var W_Subst_Date1 = ''; var W_Subst_Date2 = ''; };
if (Date_Format == 'UK') { var W_Date = W_DateUK; var W_Subst_Date2 = '}}'; };
var comment = 'if you get back to using {{subst:, then remove the following line';
  var W_Subst_Date1 = ''; var W_Subst_Date2 = ''; var W_Date_YMD = W_Date; var today_YMD = today_EN;
if (W_Newspaper=='') var W_Newspaper = WW_Newspaper;
var W_Authors = f_process_Authors_names(W_Authors);
if (User_Prefix!='') var User_Prefix = User_Prefix + '_';
var W_Ref_Name = User_Prefix + W_Newspaper.replace(/ /g, '_') + '_';
if (Ref_Name_Short.match(/Y/i)) var W_Ref_Name = User_Prefix + f_Newspaper_Name_Short(W_Newspaper) + '_';
if (sItalic == '') {
  var W_Newspaper = W_Newspaper + ' - ' + W_Date;
  var W_Date = '';
};
var s = '[' + W_URL + ' ' + W_Title + ']';
if (W_Date!='') var s = s + ', ' + W_Date;
if (W_Authors!='') var s = s + ', ' + W_Authors;
if (W_Newspaper!='') var s = s + ', ' + sItalic + W_Newspaper + sItalic;
var Ref_Name_Date = today_EN.replace(/[ ,]+/g, '_');
if (Ref_Name_Date_Publication_Date.match(/Y/i)) var Ref_Name_Date =  W_Date.replace(/[ ,\/]+/g, '_');
var ref1r = '<ref name=' + dq + W_Ref_Name + Ref_Name_Date + 'r' + dq + '>';
var ref1c = '<ref name=' + dq + W_Ref_Name + Ref_Name_Date + 'c' + dq + '>';
if (Without_Reference_Name.match(/Y/i)) { var ref1r = '<ref>'; var ref1c = '<ref>'; }
var ref2 = ', retrieved at ' + today_EN + '</ref>';
var sr =  ref1r + s + ref2;
var ref = '{{cite web |url=' + document.URL + ' |title=' + W_Title + ' |newspaper='+ W_Newspaper + ' |date= '+ W_Subst_Date1 + W_Date_YMD + W_Subst_Date2 + ' |author=' + W_Authors;
if (Archive.match(/Y/i)) var ref = ref + ' |archiveurl=' + 'http://web.archive.org/web/29991212/' + u + ' |archivedate=' + today_YMD;
var ref = ref+ ' |accessdate= ' + W_Subst_Date1 + today_YMD + W_Subst_Date2 + '}}';
var ref = ref1c + ref + '</ref>';
var sd = '[' + W_URL + ' ' + sItalic + W_Newspaper + sItalic + ', ' + W_Date + ']';
var stl = W_Title + ' - ' + W_URL;
var s = '* ' + s;
var comment = 'S = External Link   -   it will look like this:';
       var comment = '* [http://www.bbc.com/news/science-environment-23814524 Sea otter return boosts ailing seagrass in California], 26 August 2013, Suzi Gage, \'\'BBC\'\'';
var comment = 'SR = Reference using <ref>   -   it will look like this:';
       var comment = '<ref name=\'BBC_2014-05-09r\'>[http://www.bbc.com/news/science-environment-23814524 Sea otter return boosts ailing seagrass in California], 26 August 2013, Suzi Gage, \'\'BBC\'\', retrieved at 2014-05-09</ref>';
var comment = 'SC = Reference using {{cite web}}   -   it will look like this:';
       var comment = '<ref name=\'BBC_2014-05-09c\'>{{cite web |url=http://www.bbc.com/news/science-environment-23814524 |title=Sea otter return boosts ailing seagrass in California |newspaper=BBC |date= 26 August 2013 |last=Suzi Gage |accessdate=2014-05-09}}</ref>';
var sc = ref;
var comment = 'SLPD = Link, Publication, Date';
  var slpd = sd;
var comment = 'SLAPD = Link, Author(s), Publication, Date';
  var slapd = '[' + W_URL + ' ' + W_Authors + ', ' + sItalic + W_Newspaper + sItalic + ', ' + W_Date + ']';
var comment = 'STD = Title and Date';
  var std = W_Title + ' - ' + W_Date;
var comment = 'SDL = Date and Link (url)';
  var sdl = W_Date + ' - ' + W_URL;
var s = prompt('Wiki-Reference', sc);