Error using urlfilter (line 26) Target string byruling/true/">True does not appear
data points
This is a score of Barack Obama's truthiness (thanks for creating that word Colbert) based on ratings of his comments by Politifact.com
The score is a weighted average based on the following point scheme:
http://www.politifact.com/personalities/barack-obama/
| Time Recorded (time1471) | Data (data1471) |
|---|---|
| 13 Dec 2012 06:01:04 | |
| 12 Dec 2012 06:00:50 | [0.223451327433628] |
| 11 Dec 2012 06:00:55 | [0.223451327433628] |
| 10 Dec 2012 06:00:55 | [0.223451327433628] |
| 09 Dec 2012 06:00:55 | [0.223451327433628] |
url = 'http://www.politifact.com/personalities/barack-obama/'; vals = urlfilter(url, 'byruling/true/">True',36); % this gets 36 numbers for each ruling score = (2*vals(1)+vals(7)-vals(19)-2*vals(25)-3*vals(31))/sum(vals([1 7 13 19 25 31])); updatetrend(score);
1 comment
Very cool use of URLFILTER. I had to look at the source for the page you were scraping, but now I see why you had to get 12 numbers. Thanks for putting the comment in the code.