User:Ark25/RefScript

__NOINDEX__

Description
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:
 * http://www.bbc.co.uk/news/science-environment-23814524
 * http://www.dailymail.co.uk/news/article-2384832/Great-White-sharks-hunt-seals-South-Africa.html
 * http://arstechnica.com/science/2012/04/organisms-that-once-stuck-to-rocks-evolved-the-ability-to-move-out-of-the-way-of-predators/

The script can transform those links into this:

References using cite web:

Plain references:

External links:
 * Sea otter return boosts ailing seagrass in California, 26 August 2013, Suzi Gage, BBC
 * 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
 * Evolution in motion: organisms once stuck to rocks can now evade predators, 17 April 2012, John Timmer, Ars Technica

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

Using cite web:

Plain references:


 * Notes

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:
 * With New File Preview And Mobile Experiences, Box Highlights Recent Acquisitions, Techcrunch.com

or into a reference like this:

How to use the script
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 - you can do that simply by clicking here
 * Copy all the script into your clipboard (without the &lt;syntaxhighlight lang="javascript"> and the &lt;/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


 * Now, when you read an newspaper article, if you want to create the reference, just click the bookmark and it will open an alert window, putting there the already formatted reference. Now you can copy the reference and use it in any Wikipedia article.
 * also check:
 * Use bookmarklets to quickly perform common web page tasks in Firefox
 * Creating a Simple Bookmarklet - YouTube

Improving the script
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.