diff --git a/yahoo/finance/yahoo.finance.analystopinion.xml b/yahoo/finance/yahoo.finance.analystopinion.xml
index 2d94efef..f8a11bf6 100644
--- a/yahoo/finance/yahoo.finance.analystopinion.xml
+++ b/yahoo/finance/yahoo.finance.analystopinion.xml
@@ -1,13 +1,11 @@
- Gang Liang
-
- Yahoo Finance - Analyst Estimate by Stock Symbol
-
-
- SELECT * FROM {table} WHERE symbol='PRLB'
-
+ Sanjoy Ghosh
+ Returns Analyst Opinions from the Yahoo Analyst Opinion page
+
+
+ select * from {table} where symbol = 'aapl'
@@ -20,68 +18,121 @@
;
- var i = 0;
- while(i < aequery.length())
- {
- var table = aequery[i];
- var thead = table.tr[0];
- var tname = thead.th[0].strong.text().toString().replace(/ /g, "");
- var fname1 = thead.th[1].p.text().toString().replace(/\n.*/, "");
- var fname2 = thead.th[2].p.text().toString().replace(/\n.*/, "");
- var fname3 = thead.th[3].p.text().toString().replace(/\n.*/, "");
- var fname4 = thead.th[4].p.text().toString().replace(/\n.*/, "");
- fname1 = fname1.replace(/[\s\.]+/g, "").replace(/\&/,"");
- fname2 = fname2.replace(/[\s\.]+/g, "").replace(/\&/,"");
- fname3 = fname3.replace(/[\s\.]+/g, "").replace(/\&/,"");
- fname4 = fname4.replace(/[\s\.]+/g, "").replace(/\&/,"");
-
- var tblval = <{tname}>{tname}>;
- var j = 1;
- while(j < table.tr.length())
- {
- var row = table.tr[j].td;
- var rname = row[0].p.text().toString().replace(/[\s\.]+/g, "");
- rname = rname.replace(/\(.*\)/g,"").replace(/\%/,"").replace(/^(\d)/,"_$1");
- rname = rname.replace(/\//, "");
- var rval1 = getelement(row[1]);
- var rval2 = getelement(row[2]);
- var rval3 = getelement(row[3]);
- var rval4 = getelement(row[4]);
- tblval.appendChild(<{rname}>
- <{fname1}>{rval1}{fname1}>
- <{fname2}>{rval2}{fname2}>
- <{fname3}>{rval3}{fname3}>
- <{fname4}>{rval4}{fname4}>
- {rname}>);
- j = j + 1;
- }
- aedata.appendChild(tblval);
- i = i + 1;
- }
-
- // Return aedata strucuture
+
+ var aedata = ;
+
+
+ var thisWeekQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1 equaltable']//td/p[text() = 'Mean Recommendation (this week):']/../../td[2]/p");
+ var thisWeek = thisWeekQuery.text();
+
+ var lastWeekQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1 equaltable']//td/p[text() = 'Mean Recommendation (last week):']/../../td[2]/p");
+ var lastWeek = lastWeekQuery.text();
+
+ var changeQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1 equaltable']//td/p[text() = 'Change:']/../../td[2]/p");
+ var change = changeQuery.text();
+
+ var recommendationSummary = ;
+ aedata.appendChild(recommendationSummary);
+
+
+ var meanQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1 equaltable']//td/p[text() = 'Mean Target:']/../../td[2]/p");
+ var mean = meanQuery.text();
+
+ var medianQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1 equaltable']//td/p[text() = 'Median Target:']/../../td[2]/p");
+ var median = medianQuery.text();
+
+ var highQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1 equaltable']//td/p[text() = 'High Target:']/../../td[2]/p");
+ var high = highQuery.text();
+
+ var lowQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1 equaltable']//td/p[text() = 'Low Target:']/../../td[2]/p");
+ var low = lowQuery.text();
+
+ var numOfBrokersQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1 equaltable']//td/p[text() = 'No. of Brokers:']/../../td[2]/p");
+ var numOfBrokers = numOfBrokersQuery.text();
+
+ var priceTargetSummary = ;
+ aedata.appendChild(priceTargetSummary);
+
+
+ var strongBuyCurrentMonthQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Strong Buy']/../../td[1]/p");
+ var strongBuyCurrentMonth = strongBuyCurrentMonthQuery[0].text();
+
+ var strongBuyLastMonthQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Strong Buy']/../../td[2]/p");
+ var strongBuyLastMonth = strongBuyLastMonthQuery[0].text();
+
+ var strongBuyTwoMonthsAgoQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Strong Buy']/../../td[3]/p");
+ var strongBuyTwoMonthsAgo = strongBuyTwoMonthsAgoQuery[0].text();
+
+ var strongBuyThreeMonthsAgoQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Strong Buy']/../../td[4]/p");
+ var strongBuyThreeMonthsAgo = strongBuyThreeMonthsAgoQuery[0].text();
+
+
+ var buyCurrentMonthQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Buy']/../../td[1]/p");
+ var buyCurrentMonth = buyCurrentMonthQuery[0].text();
+
+ var buyLastMonthQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Buy']/../../td[2]/p");
+ var buyLastMonth = buyLastMonthQuery[0].text();
+
+ var buyTwoMonthsAgoQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Buy']/../../td[3]/p");
+ var buyTwoMonthsAgo = buyTwoMonthsAgoQuery[0].text();
+
+ var buyThreeMonthsAgoQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Buy']/../../td[4]/p");
+ var buyThreeMonthsAgo = buyThreeMonthsAgoQuery[0].text();
+
+
+ var holdCurrentMonthQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Hold']/../../td[1]/p");
+ var holdCurrentMonth = holdCurrentMonthQuery[0].text();
+
+ var holdLastMonthQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Hold']/../../td[2]/p");
+ var holdLastMonth = holdLastMonthQuery[0].text();
+
+ var holdTwoMonthsAgoQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Hold']/../../td[3]/p");
+ var holdTwoMonthsAgo = holdTwoMonthsAgoQuery[0].text();
+
+ var holdThreeMonthsAgoQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Hold']/../../td[4]/p");
+ var holdThreeMonthsAgo = holdThreeMonthsAgoQuery[0].text();
+
+
+ var underperformCurrentMonthQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Underperform']/../../td[1]/p");
+ var underperformCurrentMonth = underperformCurrentMonthQuery[0].text();
+
+ var underperformLastMonthQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Underperform']/../../td[2]/p");
+ var underperformLastMonth = underperformLastMonthQuery[0].text();
+
+ var underperformTwoMonthsAgoQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Underperform']/../../td[3]/p");
+ var underperformTwoMonthsAgo = underperformTwoMonthsAgoQuery[0].text();
+
+ var underperformThreeMonthsAgoQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Underperform']/../../td[4]/p");
+ var underperformThreeMonthsAgo = underperformThreeMonthsAgoQuery[0].text();
+
+
+ var sellCurrentMonthQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Sell']/../../td[1]/p");
+ var sellCurrentMonth = sellCurrentMonthQuery[0].text();
+
+ var sellLastMonthQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Sell']/../../td[2]/p");
+ var sellLastMonth = sellLastMonthQuery[0].text();
+
+ var sellTwoMonthsAgoQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Sell']/../../td[3]/p");
+ var sellTwoMonthsAgo = sellTwoMonthsAgoQuery[0].text();
+
+ var sellThreeMonthsAgoQuery = y.xpath(rawresult,"//table[@class='yfnc_datamodoutline1']//th/p[text() = 'Sell']/../../td[4]/p");
+ var sellThreeMonthsAgo = sellThreeMonthsAgoQuery[0].text();
+
+
+ var recommendationTrends =
+
+
+
+
+ ;
+ aedata.appendChild(recommendationTrends);
+
response.object = aedata;
]]>
-
-
+
\ No newline at end of file