PageSourceSearch

https://research.news/javascripts/InArticleBlurbs.js

js research.news collected 2026-10-04 00:06:54 UTC 27,273 bytes, 419 lines download raw bytes

1//UPDATED ON 1/9/2020 12:40:00 PM
2//FOR NATURALNEWS.COM ONLY
3
4$(document).ready(function() {
5InArticleBlurb('#InArticleBlurb');
6});
7
8////////////////////////////////////////////////////////////////////////////////////////////////////////
9
10function InArticleBlurb(vMarker) {
11if ($(vMarker).length > 0) {
12UpdateStatus('Marker Found.');
13var vCode = GetBlurb();
14$(vMarker).replaceWith(vCode); 
15};
16}; 
17
18////////////////////////////////////////////////////////////////////////////////////////////////////////
19
20function GetBlurb() {
21
22//use keywords to find most appropriate blurb (score/highscore system)
23//higher priority number increases score (for odds or tie-breakers)
24//must escape the apostrophe in the blurb code (ex: Health Ranger\'s) 
25//use tag for the url: {URL} UTM codes will be added onto urls (if equals true)
26//expire date format: 1/06/2020
27
28var vWinner = "";
29var vHighScore = 0;
30var vBlurbCode = "";
31
32var vUseRandom = false; //true or false
33
34//---------------------------------------------------------
35
36var ranNums = shuffle([ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 ]);
37$.each(ranNums, function( index, x ) {
38switch (x) {
39	
40case 1:
41var vCampaign = "Biostructured Silver Gel";
42var vURL = "https://organicfacialandeyeserum.naturalnews.com/organic-facial-eye-serum.html";
43var vUTM = true;
44var vExpire = "";
45var vPriority = 6;
46var vKeywords = "silver,antibiotics,superbugs,colloidal silver,ionic silver,first aid,emergency medicine,herbs,natural medicine,naturopathy,survival,survival gear,essential oils,herbal medicine,natural health,emergency medicine,preparedness,gear,infections,outbreak,pandemic,wounds,skin care,cosmetics,personal care products,antibacterial,antifungal";
47var vExcludeWords = "";
48var vCode = '<p style="display: block; width: auto; background-color: #f5effb; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;"><b>Sponsored: NEW Biostructured Silver First Aid Gel</b> created by the Health Ranger combines three types of silver (ionic silver, colloidal silver, biostructured silver) with seven potent botanicals (rosemary, oregano, cinnamon and more) to create a <b>breakthrough first aid silver gel</b>. Over 50 ppm silver, verified via ICP-MS lab analysis. Made from 100% Texas rain water and 70% solar power. Zero chemical preservatives, fragrances or emulsifiers. <a href="{URL}" target="_blank">See full details here</a>.</p>';
49break;
50
51case 2:
52var vCampaign = "Heart Disease eBook";
53var vURL = "https://prevent-and-reverse-heart-disease.naturalnews.com";
54var vUTM = false;
55var vExpire = "";
56var vPriority = 6;
57var vKeywords = "heart disease,prevention,heart health,CVD,blood pressure,circulation,goodhealth,badhealth,hypertension,statins,statin drugs,cardiac health,Big Pharma,dangerous medicine,prescription drugs";
58var vExcludeWords = "";
59var vCode = '<table style="width: 100%; background-color: #f2f2f2; margin: 30px auto; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;" border="0" width="100%" cellspacing="15"><tbody><tr><td style="width: 20%;" valign="top"><a href="{URL}" target="_blank"><img style="border: none;" src="https://www.naturalnews.com/Images/Heart-Disease-Ebook-150.png" alt="ebook" /></a></td><td style="width: auto; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%;" valign="top"><em><strong>Discover how to prevent and reverse heart disease (and other cardio related events) with this free ebook</strong>: Written by popular Natural News writer Vicki Batt, this book includes <a href="{URL}" target="_blank">everything you need to know</a> about preventing heart disease, reversing hypertension, and nurturing your cardiac health without medication. <a href="{URL}" target="_blank">Learn More.</a></em></td></tr></tbody></table>';
60break;
61
62case 3:
63var vCampaign = "Glyphosate Testing at Health Ranger Store";
64var vURL = "https://www.healthrangerstore.com";
65var vUTM = true;
66var vExpire = "";
67var vPriority = 5;
68var vKeywords = "superfoods,nutrition,heavy metals,goodhealth,badhealth,cancer,heart disease,diabetes,Alzheimer's,glyphosate,herbicides,pesticides,clean food,environ,nutrients,superfood,goodmedicine,turmeric,supplements,goodfood,goodhealth,badfood,badhealth,badmedicine,goodscience,environ,Monsanto,vitamins,ingredients";
69var vExcludeWords = "";
70var vCode = '<p style="display: block; width: auto; background-color: #ffffe6; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;"><em><b>GLYPHOSATE testing is now being applied to all Health Ranger Store branded products.</b> Our in-house lab uses LC-MS-MS (triple quad mass spec). See the full <a href="{URL}" target="_blank">lab science tour video and announcement here</a>. Shop for ultra-clean, lab-tested superfoods, personal care products and more at <a href="{URL}" target="_blank">the Health Ranger Store</a>, the world\'s most trusted source for clean foods and lab-verified nutritional solutions.</em></p>';
71break;
72
73case 4:
74var vCampaign = "Essential Oil Sets";
75var vURL = "http://organicessentialoils.naturalnews.com/organic-essential-oil-gift-set.html";
76var vUTM = true;
77var vExpire = "";
78var vPriority = 6;
79var vKeywords = "essential oils,herbs,herbal,natural medicine,oregano,tea tree,first aid,emergency medicine,personal care,cosmetics,anxiety,stress,depression,stress reduction,goodhealth,badhealth,natural medicine,alternative medicine,phytochemicals,phytonutrients";
80var vExcludeWords = "cancer, tumors, anti-cancer";
81var vCode = '<p style="display: block; width: auto; background-color: #f2f2f2; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;"><em><strong>100% organic essential oil sets now available</strong> for your home and personal care, including Rosemary, Oregano, Eucalyptus, Tea Tree, Clary Sage and more, all 100% organic and laboratory tested for safety. A multitude of uses, from stress reduction to topical first aid. <a href="{URL}" target="_blank">
81See the complete listing here</a>, and help support this news site. </em></p>';
82break;
83
84case 5:
85var vCampaign = "Colloidal Silver Mouthwash";
86var vURL = "https://colloidalsilvermouthwash.healthrangerstore.com/colloidal-silver-mouthwash.html";
87var vUTM = true;
88var vExpire = "";
89var vPriority = 6;
90var vKeywords = "breath,prevention,goodhealth,health,dental,dentistry,oral health,teeth,mouthwash,toothpaste,personal care,prevention,healthy living,natural health,natural medicine,herbs,natural products";
91var vExcludeWords = "";
92var vCode = '<p style="display: block; width: auto; background-color: #f2f2f2; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;"><em><strong>The power of the elements</strong>: Discover Colloidal Silver Mouthwash with quality, natural ingredients like Sangre de Drago sap, black walnut hulls, menthol crystals and more. Zero artificial sweeteners, colors or alcohol. <a href="{URL}" target="_blank">Learn more at the Health Ranger Store</a> and help support this news site.</em></p>';
93break;
94
95case 6:
96var vCampaign = "Broccoli Sprouts Capsules";
97var vURL = "https://organicbroccolisproutpowder.naturalnews.com/organic-broccoli-sprout-powder-capsules";
98var vUTM = true;
99var vExpire = "";
100var vPriority = 6;
101var vKeywords = "food,goodfood,healing foods,grocery,groceries,superfood,superfoods,nutrients,nutrition,prevention,supplements,vitamins,minerals,plant medicine,natural medicine,natural health,heart health,heart,liver,food,ingredients";
102var vExcludeWords = "sulforaphane,glucosinoate,glucosinolates,cruciferous,cancer,anti-cancer,cancer prevention,tumors";
103var vCode = '<p style="display: block; width: auto; background-color: #f2f2f2; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;"><em><strong>Mother Nature\'s micronutrient secret</strong>: Organic Broccoli Sprout Capsules now available, delivering 280mg of high-density nutrition, including the extraordinary "sulforaphane" and "glucosinolate" nutrients found only in cruciferous healing foods. Every lot laboratory tested. <a href="{URL}" target="_blank">See availability here.</a></em></p>';
104break;
105
106case 7:
107var vCampaign = "Clean Food at the Health Ranger Store";
108var vURL = "http://healthrangerstore.com";
109var vUTM = true;
110var vExpire = "";
111var vPriority = 5;
112var vKeywords = "cancer,breast cancer,prostate cancer,diabetes,heart disease,Alzheimer's,dementia,Alzheimers,disease,statins,high cholesterol,high blood pressure,blood pressure,depression,detox,heavy metals,pollution,badpollution,clean water,cadmium,arsenic,mercury,contamination,exposure,radiation,cesium,Fukushima,clean food,superfood,sleep,cognitive function,neurology,brain health";
113var vExcludeWords = "";
114var vCode = '<p style="display: block; width: auto; background-color: #f2f2f2; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;"><em><strong>Get CLEAN FOOD and help support our mission to keep you informed</strong>: The <a href = "{URL}" target="_blank">Health Ranger Store</a> lab verifies everything we sell with accredited testing for heavy metals, microbiology and food safety. Certified organic facility, ISO-accredited on-site laboratory, no GMOs or synthetic ingredients. The world\'s #1 source of lab-verified clean foods and superfoods for nutritional healing. 600+ products available. <a href = "{URL}" target="_blank">Explore now.</a></em></p>';
115break;
116
117case 8:
118var vCampaign = "Turmeric Gummy Bears and Gold Liquid Extract";
119var vURL = "http://turmericsupercombopack.naturalnews.com/turmeric-gummy-bears-liquid-extract.html";
120var vUTM = true;
121var vExpire = "";
122var vPriority = 5;
123var vKeywords = "superfoods,nutrients,nutrition,healing foods,ingredients,spice,snacks,food,food science,vitamin D,vitamin C,prevention,remedies,cures,natural cures,natural remedies,natural medicine,herbs,herbal medicine,botanical medicine,essential oils,healing,alternative medicine,Chinese medicine,anti-aging,longevity,fitness,exercise,working out,muscles,weight lifting,statins,statin drugs,Big Pharma";
124var vExcludeWords = "turmeric,curcumin,cancer,Alzheimers,dementia,diabetes,heart disease,blood pressure,breast cancer,prostate cancer,Alzheimer's,liver disease,heart disease,high blood pressure";
125var vCode = '<p style="display: block; width: auto; background-color: #f2f2f2; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;"><em><strong>Support our mission to keep you informed</strong>: Discover the extraordinary benefits of <a href = "{URL}" target="_blank">turmeric gummy bears and organic "turmeric gold" liquid extract</a>, both laboratory tested for heavy metals, microbiology and safety. Naturally high in potent curcuminoids. Delicious formulations. All purchases support this website (as well as your good health). <a href = "{URL}" target="_blank">See availability here.</a></em></p>';
126break;
127
128case 9:
129var vCampaign = "Heavy Metals Test Kit";
130var vURL = "http://cwclabs.naturalnews.com/CWC-Labs.html";
131var vUTM = true;
132var vExpire = "";
133var vPriority = 5;
134var vKeywords = "heavy metals,mercury,pollution,cadmium,arsenic,aluminum,metals,lead poisoning,water quality,water pollution,clean water,air pollution";
135var vExcludeWords = "";
136var vCode = '<p style="display: block; width: auto; background-color: #F2F2F2; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;"><em><b>
136Sponsored solution from CWC Labs:</b> This <a href="{URL}" target="_blank">heavy metals test kit</a> allows you to test almost anything for 20+ heavy metals and nutritive minerals, including lead, mercury, arsenic, cadmium, aluminum and more. You can test your own hair, vitamins, well water, garden soil, superfoods, pet hair, beverages and other samples (no blood or urine). ISO accredited laboratory using ICP-MS (mass spec) analysis with parts per billion sensitivity. <a href="{URL}" target="_blank">Learn more here</a>.</em></p>';
137break;
138
139case 10:
140var vCampaign = "Berkey Water Filter";
141var vURL = "http://bigberkey.naturalnews.com";
142var vUTM = true;
143var vExpire = "";
144var vPriority = 2;
145var vKeywords = "water quality,water pollution,clean water,water filters,well water,municipal water,survival,preparedness,disaster,chaos,emergency preparedness,prepping,preppers,non-electric,EMP,EMP attack,grid down,collapse";
146var vExcludeWords = "";
147var vCode = '<p style="display: block; width: auto; background-color: #f2f2f2; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;"><em><b>Sponsored solution from the Health Ranger Store:</b> The <a href="{URL}" target="_blank">Big Berkey water filter</a> removes almost 100% of all contaminants using only the power of gravity (no electricity needed, works completely off-grid). Widely consider the ultimate "survival" water filter, the Big Berkey is made of stainless steel and has been laboratory verified for high-efficiency removal of heavy metals by CWC Labs, with tests personally conducted by Mike Adams. <a href="{URL}" target="_blank">
147Explore more here</a>.</em></p>';
148break;
149
150case 11:
151var vCampaign = "Iodine";
152var vURL = "http://iodine.naturalnews.com/iodine.html";
153var vUTM = true;
154var vExpire = "";
155var vPriority = 4;
156var vKeywords = "nuclear war,WWIII,radiation,nuclear attack,nuclear power,survival,prepping,preparedness,Fukushima,Cesium";
157var vExcludeWords = "cancer,breast cancer,prostate cancer,prevention";
158var vCode = '<p style="display: block; width: auto; background-color: #F2F2F2; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;"><em><b>Sponsored solution from the Health Ranger Store:</b> Lab-verified <a href="{URL}" target="_blank">Nascent Iodine solution</a> is a dietary supplement that provides your body with supplemental iodine to help protect your thyroid during radiation exposure. Nuclear accidents such as Fukushima (or nuclear war) can expose your body to radioactive iodine-131, a dangerous radioisotope. Pre-loading your system with stable iodine occupies the iodine receptor sites on your organs, causing your body to naturally expel radioactive iodine you may have been exposed to through air, food, water or milk products. This defensive strategy is recommended by nearly all health authorities, worldwide, including the Nuclear Regulatory Commission. <a href="{URL}" target="_blank">Discover more at this link</a>.</em></p>';
159break;
160
161case 12:
162var vCampaign = "Ranger Buckets";
163var vURL = "http://rangerorganicemergencyfood.naturalnews.com/RangerOrganicEmergencySurvivalFood.html";
164var vUTM = true;
165var vExpire = "";
166var vPriority = 1;
167var vKeywords = "storable food,emergency food,food collapse,survival,disaster preparedness,natural disasters,martial law,survival supplies,emergency medicine,financial collapse,nuclear war,EMP attack,social unrest,civil war";
168var vExcludeWords = "";
169var vCode = '<p style="display: block; width: auto; background-color: #f2f2f2; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;"><em><strong>Support our mission and enhance your own self-reliance</strong>: The laboratory-verified <a href="{URL}" target="_blank">Organic Emergency Survival Bucket</a> provides certified organic, high-nutrition storable food for emergency preparedness. Completely free of corn syrup, MSG, GMOs and other food toxins. Ultra-clean solution for years of food security. Learn more at <a href="{URL}" target="_blank">the Health Ranger Store</a>.</em></p>';
170break;
171
172case 13:
173var vCampaign = "NN Mobile App";
174var vURL = "https://www.naturalnews.com/2017-07-18-natural-news-releases-new-app-for-android-iphone.html";
175var vUTM = false;
176var vExpire = "";
177var vPriority = 1;
178var vKeywords = "food,herbs,medicine,science,technology,vaccines,survival,gear,GMO,ingredients,healing foods,fruits,superfood,science,medicine,cancer,diabetes,heart disease,science,pollution,climate,climate change,climate science,nutrition,medicine,badhealth,badmedicine,badscience,badpollution";
179var vExcludeWords = "";
180var vCode = '<p style="display: block; width: auto; background-color: #f2f2f2; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;"><em><strong>Get more news like this without being censored</strong>: Get the <a href="{URL}" target="_blank">Natural News app</a> for your mobile devices. Enjoy uncensored news, lab test results, videos, podcasts and more. Bypass all the unfair censorship by Google, Facebook, YouTube and Twitter. Get your daily news and videos directly from the source! <a href="{URL}" target="_blank">
180Download here</a>.</em></p>';
181break;
182
183case 14:
184var vCampaign = "Seeds of Life";
185var vURL = "http://organicseedsoflife.naturalnews.com/organic-seeds-of-life.html";
186var vUTM = true;
187var vExpire = "";
188var vPriority = 5;
189var vKeywords = "herbs,nutrients,food,nutrition,superfood,superfoods,natural medicine,healing food,ingredients,organics,healing food,groceries,supplements,natural medicine,prevention,vitamins,antioxidants,organic,vegetables,veggies,fruits,fiber";
190var vExcludeWords = "cancer,anti-cancer,cancer prevention,breast cancer,prostate cancer,tumors,cancer tumors";
191var vCode = '<p style="display: block; width: auto; background-color: #F2F2F2; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;"><em><strong>Support our mission and protect your health: </strong><a href="{URL}" target="_blank">Organic Seeds of Life</a> combines Red Raspberry Seed Power, Black Cumin Seed Power and Red Grape Seed Powder into the most potent nutrient-rich supplemental superfood powder you\'ve ever experienced. Loaded with flavonoids, antioxidants, anthocyanins, OPCs, ALA and a vast array of vital nutrients. <a href="{URL}" target="_blank">Learn more here</a>.</em></p>';
192break;
193
194case 15:
195var vCampaign = "New Year Resolution";
196var vURL = "https://happynewyear2020.naturalnews.com/new-year-resolution-event-2020";
197var vUTM = true;
198var vExpire = "1/06/2020";
199var vPriority = 10;
200var vKeywords = "";
201var vExcludeWords = "";
202var vCode = '<p style="display: block; width: auto; background-color: #fbfbef; color: #000000; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 130%; margin: 30px auto; padding: 15px; border-top: solid 1px #CCCCCC; border-bottom: solid 1px #CCCCCC;">Less than 48 hours remaining at the <b>Health Ranger Store\'s New Year\'s Resolution Sale</b>. Last chance to get amazing deals on over 60 lab-verified supplements, superfoods, essential oils and more... enjoy up to <strong>40% OFF</strong> selected items. This limited-time sale ends Jan. 6 at NOON CST, or while supplies last. <a href="{URL}" target="_blank">Learn more here</a>.</p>';
203break;
204
205};
206
207//---------------------------------------------------------
208
209var vRemove = false; // default value)
210
211if (vExpire != "") {
212vRemove = ExpireCheck(vExpire); // Blurb expire date exists, check to see if it should be removed.
213if (vRemove == true) {
214UpdateStatus(vCampaign + " has expired.");
215};
216};
217
218if (vRemove == false && vExcludeWords !="") {
219vRemove = ExcludeCheck(vExcludeWords); // Exclude Words exist, check to see if blurb should NOT be used.
220if (vRemove == true) {
221UpdateStatus(vCampaign + " has exclude words.");
222};
223};
224
225//---------------------------------------------------------
226
227if (vRemove == false) { //Still false, so Blurb is good to use.
228
229//----------------------
230
231var vScore = KeywordScore(vKeywords);
232vScore = vScore + vPriority;
233UpdateStatus(vCampaign + ": " + vScore);
234
235//----------------------
236
237if (vScore > vHighScore) { //New highscore. Make this the new blurb.
238vHighScore = vScore;
239vWinner = vCampaign;
240if (vUTM == true) {
241vCampaign = vCampaign.replace(/ /g,"-"); //Replace all spaces with a dash
242vURL = vURL + '?utm_source=NaturalNews.com&utm_campaign=' + vCampaign + '&utm_medium=InArticleBlurb';
243};
244vBlurbCode = vCode.replace(/{URL}/g,vURL); //replace all url tags with utm source url
245};
246
247//----------------------
248
249}; //vRemove == false
250
251//---------------------------------------------------------
252
253if (vUseRandom == true && vBlurbCode != "") {
254return false; // stop each and use first good blurb
255UpdateStatus("Using Random Blurb");
256};
257
258//---------------------------------------------------------
259
260}); //each
261
262UpdateStatus("Winner: " + vWinner + " (" + vHighScore + ")");
263
264return vBlurbCode;
265
266};
267
268////////////////////////////////////////////////////////////////////////////////////////////////////////
269////////////////////////////////////////////////////////////////////////////////////////////////////////
270////////////////////////////////////////////////////////////////////////////////////////////////////////
271////////////////////////////////////////////////////////////////////////////////////////////////////////
272////////////////////////////////////////////////////////////////////////////////////////////////////////
273////////////////////////////////////////////////////////////////////////////////////////////////////////
274////////////////////////////////////////////////////////////////////////////////////////////////////////
275////////////////////////////////////////////////////////////////////////////////////////////////////////
276////////////////////////////////////////////////////////////////////////////////////////////////////////
277////////////////////////////////////////////////////////////////////////////////////////////////////////
278
279function shuffle(array) {
280var i = array.length,
281j = 0,
282temp;
283while (i--) {
284j = Math.floor(Math.random() * (i+1));
285// swap randomly chosen element with current element
286temp = array[i];
287array[i] = array[j];
288array[j] = temp;
289};
290return array;
291};
292
293////////////////////////////////////////////////////////////////////////////////////////////////////////
294
295function CharacterCleanup(vText) {
296vText = vText.replace(/[^a-zA-Z0-9 ]/g, ''); //removes all characters from string (except letters, numbers and spaces)
297vText = vText.replace('  ',' '); //remove double spaces
298vText = vText.toLowerCase(); //make lowercase
299return vText;
300};
301
302////////////////////////////////////////////////////////////////////////////////////////////////////////
303
304function KeywordScore(vKeywords) {
305var vScore = 0;
306var vTitle =$(document).find("title").text();
307var vDescription =$('meta[property="og:description"]').attr('content');
308var vMetaKeywords = '';
309var vMetaKeywords =$("meta[name='keywords']").attr("content");$('meta[property=article\\:tag]').each(function() {
310var vTest =$(this).attr('content');
311vMetaKeywords += vTest + ", ";
312});
313if (vTitle != null) {
314vTitle = CharacterCleanup(vTitle);
315} else {
316vTitle = "";
317};
318if (vDescription != null) {
319vDescription = CharacterCleanup(vDescription);
320} else {
321vDescription = "";
322};
323if (vMetaKeywords != null) {
324vMetaKeywords = CharacterCleanup(vMetaKeywords);
325} else {
326vMetaKeywords = "";
327};
328var a = vKeywords.split(",");
329for (var x = 0, y = a.length; x < y; x++) {
330var vKey = a[x];
331vKey = vKey.trim();
332vKey = vKey.toLowerCase();
333if (vMetaKeywords.indexOf(vKey) >= 0) { //keyword found in metakeywords
334vScore = vScore + 10;
335//UpdateStatus('"' + vKey + '" found in keywords');
336};
337if (vTitle.indexOf(vKey) >= 0) { //keyword found in title
338vScore = vScore + 30;
339//UpdateStatus('"' + vKey + '" found in title');
340};
341if (vDescription.indexOf(vKey) >= 0) { //keyword found in description
342vScore = vScore + 15;
343//UpdateStatus('"' + vKey + '" found in description');
344};
345};
346return vScore;
347};
348
349////////////////////////////////////////////////////////////////////////////////////////////////////////
350
351function ExcludeCheck(vExcludeWords) {
352var vTitle =$(document).find("title").text();
353var vDescription =$('meta[property="og:description"]').attr('content');
354var vMetaKeywords = '';
355var vMetaKeywords =$("meta[name='keywords']").attr("content");$('meta[property=article\\:tag]').each(function() {
356var vTest =$(this).attr('content');
357vMetaKeywords += vTest + ", ";
358});
359if (vTitle != null) {
360vTitle = CharacterCleanup(vTitle);
361} else {
362vTitle = "";
363};
364if (vDescription != null) {
365vDescription = CharacterCleanup(vDescription);
366} else {
367vDescription = "";
368};
369if (vMetaKeywords != null) {
370vMetaKeywords = CharacterCleanup(vMetaKeywords);
371} else {
372vMetaKeywords = "";
373};
374var vRemove = false;
375var a = vExcludeWords.split(",");
376for (var x = 0, y = a.length; x < y; x++) {
377var vKey = a[x];
378vKey = vKey.trim();
379vKey = vKey.toLowerCase();
380if (vMetaKeywords.indexOf(vKey) >= 0) { //exclude found in metakeywords
381vRemove = true;
382//UpdateStatus('"' + vKey + '" found in keywords');
383};
384if (vTitle.indexOf(vKey) >= 0) { //exclude word found in title
385vRemove = true;
386//UpdateStatus('"' + vKey + '" found in title');
387};
388if (vDescription.indexOf(vKey) >= 0) { //exclude found in description
389vRemove = true;
390//UpdateStatus('"' + vKey + '" found in description');
391};
392};
393return vRemove;
394};
395
396////////////////////////////////////////////////////////////////////////////////////////////////////////
397
398function ExpireCheck(vDate) {
399var vRemove = false; //default value
400var a = vDate.split("/");
401var vMonth = (a[0] - 1); // Jan is 0, Dec is 11
402var vDay = a[1];
403var vYear = a[2];
404var vToday = new Date();
405var vExpireDate = new Date();
406vExpireDate.setFullYear(vYear, vMonth, vDay);
407if (vToday > vExpireDate) {
408var vRemove = true; //has expired
409};
410return vRemove;
411};
412
413////////////////////////////////////////////////////////////////////////////////////////////////////////
414
415function UpdateStatus(vText) {
416console.log(vText);
417};
418
419////////////////////////////////////////////////////////////////////////////////////////////////////////

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.