Irish News Links

From All n One's bxp software Wixi

Jump to: navigation, search

It can be useful to background research on a company for sales purposes. To this end bxp software can save a lot of time in research. The newspaper button links are simple JavaScript which reads the name of the company and then searches the relevant site for related articles. In this way you can scan a news paper for company related articles to further the background research of the company.

The first part is to put in a section header to hold the buttons. The following has three rows of buttons. The first are national news agencies. The second row is technical articles. The third row is to share prices.

<input type=button name=btnNewsTools1 id=btnNewsTools1 class='Master_Button' style='width:19%;' value='Irish Times' />
<input type=button name=btnNewsTools2 id=btnNewsTools2 class='Master_Button' style='width:19%;' value='Irish Independent' />
<input type=button name=btnNewsTools3 id=btnNewsTools3 class='Master_Button' style='width:19%;' value='Irish Examiner' />
<input type=button name=btnNewsTools4 id=btnNewsTools4 class='Master_Button' style='width:19%;' value='Sunday Bus. Post' />
<input type=button name=btnNewsTools5 id=btnNewsTools5 class='Master_Button' style='width:19%;' value='RTE' />
<hr noshade="noshade" />
<input type=button name=btnTechTools1 id=btnTechTools1 class='Master_Button' style='width:19%;' value='Silicon Republic' />
<input type=button name=btnTechTools2 id=btnTechTools2 class='Master_Button' style='width:19%;' value='Tech Central' />
<input type=button name=btnTechTools3 id=btnTechTools3 class='Master_Button' style='width:19%;' value='CNET' />
<input type=button name=btnTechTools4 id=btnTechTools4 class='Master_Button' style='width:19%;' value='ITLG' />
<input type=button name=btnTechTools5 id=btnTechTools5 class='Master_Button' style='width:19%;' value='Blacknight' />
<hr noshade="noshade" />
<input type=button name=btnFinancialTools1 id=btnFinancialTools1 class='Master_Button' style='width:49%;' value='Irish Share Exchange' />
<input type=button name=btnFinancialTools2 id=btnFinancialTools2 class='Master_Button' style='width:49%;' value='FTSE' />

So this adds the button, now we need to add some JavaScript to the onload of the page to add the functionality to the buttons. The first line looks up the field with the company name to do the searching on.

var strNewsKeyword = document.getElementById('strCDA_41_field_0_4').value;

//onLoad function to set up links if existing record
function fn_InitialiseNewsLinks() {

	//If the values have been initialised
	if (strNewsKeyword != '') {

		//Add the onclick event to allow window.open
		addEvent( document.getElementById('btnNewsTools1'), 'click', strURL_IrishTimes );
		addEvent( document.getElementById('btnNewsTools2'), 'click', strURL_IrishIndependent );
		addEvent( document.getElementById('btnNewsTools3'), 'click', strURL_IrishExaminer );
		addEvent( document.getElementById('btnNewsTools4'), 'click', strURL_SundayBusinessPost );
		addEvent( document.getElementById('btnNewsTools5'), 'click', strURL_RTE );
		
		addEvent( document.getElementById('btnTechTools1'), 'click', strURL_SiliconRepublic );
		addEvent( document.getElementById('btnTechTools2'), 'click', strURL_TechCentral );
		addEvent( document.getElementById('btnTechTools3'), 'click', strURL_CNET );
		addEvent( document.getElementById('btnTechTools4'), 'click', strURL_ITLG );
		addEvent( document.getElementById('btnTechTools5'), 'click', strURL_Blacknight );
		
		addEvent( document.getElementById('btnFinancialTools1'), 'click', strURL_ISE );
		addEvent( document.getElementById('btnFinancialTools2'), 'click', strURL_FTSE );
	}
}

//Daniels add event function
function addEvent( obj, type, fn ) {
	if ( obj.attachEvent ) {
		obj['e'+type+fn] = fn;
		obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
		obj.attachEvent( 'on'+type, obj[type+fn] );
	} else
	obj.addEventListener( type, fn, false );
}

//The News Sites
function strURL_IrishExaminer(){
	window.open("http://www.irishexaminer.com/search/?cx=004422957488353982429%3A4gb73lvknqy&cof=FORID%3A9&ie=UTF-8&q=" + strNewsKeyword + "&x=0&y=0");
}
function strURL_IrishTimes(){
	window.open("http://www.irishtimes.com/search/index.html?rm=listresults&filter=datedesc&keywords=" + strNewsKeyword + "&x=0&y=0");
}
function strURL_SundayBusinessPost(){
	window.open("http://www.businesspost.ie/#!search/" + strNewsKeyword + "");
}
function strURL_IrishIndependent(){
	window.open("http://www.independent.ie/search/?fromSection=ece_frontpage&search=" + strNewsKeyword + "");
}
function strURL_RTE(){
	window.open("http://www.rte.ie/search/?query=" + strNewsKeyword + "");
}

//The Tech Sites
function strURL_SiliconRepublic(){
	window.open("http://search.siliconrepublic.com/search?IW_FIELD_WEB_STYLE=" + strNewsKeyword + "&IW_DATABASE=SRNewsChain&IW_SORT=-DC.date.issued&sa.x=0&sa.y=0");
}
function strURL_CNET(){
	window.open("http://news.cnet.com/1770-5_3-0.html?query=" + strNewsKeyword + "&tag=srch&searchtype=news");
}
function strURL_Blacknight(){
	window.open("http://technology.ie/?s=" + strNewsKeyword + "&submit.x=0&submit.y=0");
}
function strURL_TechCentral(){
	window.open("http://www.techcentral.ie/search.aspx?search=" + strNewsKeyword + "&idcategory=0");
}
function strURL_ITLG(){
	window.open("http://www.itlg.org/search.php?searchBox=" + strNewsKeyword + "&p=1");
}

//The Financial Sites
function strURL_ISE(){
	window.open("http://www.ise.ie/Prices,-Indices-Stats/Equity-Market-Data/Shares-In-Issue/?list=full&type=SHARESISS");
}
function strURL_FTSE(){
	window.open("http://www.londonstockexchange.com/prices-and-markets/markets/prices.htm");
}

//OnLoad fire it all off
fn_InitialiseNewsLinks();