Owner | User:PoliticalJunkie |
---|---|
Function | Updating baseball players' stats. |
Language | English |
Program | Pywikipedia framework |
Mode | Starts manually, edits automatically, checked frequently |
Frequency | Every three days |
Thanks. - PoliticalJunkie 23:57, 29 August 2006 (UTC) reply
ESPN.com - PoliticalJunkie 14:30, 30 August 2006 (UTC) reply
It's getting the information by extracting it from ESPN using regex and a preloaded set of player URLs. For example, it takes the player URL as input, goes to that page, and then uses regex to get the necessary statistics. For updating, it's using a search and replace like function. It obtains the table on the page, (which is placed within two tags, see here for a sample edit), and then replaces it with the new, updated statistics. - PoliticalJunkie 17:29, 31 August 2006 (UTC) reply
Okay. - PoliticalJunkie 14:57, 1 September 2006 (UTC) reply
Just looking at Mark Teixeira, I have a couple of questions. Can this information be cited? Have you considered putting the information in the form of a template with the data as parameters? It would make updating it much easier, and you wouldn't need the <!--Please leave this tag here.--> markers. That would also make the bot less likely to make mistakes, since I don't think that tag is generic enough and it's easy to vandalize. If it were a template, you could also add an optional field for a reference. It shouldn't be hard to do. BTW, I think this is a great idea. — Ram-Man ( comment) ( talk) 23:12, 1 September 2006 (UTC) reply
I did consider putting it into a template, but couldn't because I don't know anything about template syntax. I was looking at Wikipedia:Template namespace to see how to accept parameters, but I don't know how to output them in table form. If you could design one using the fields on Mark Teixeira's page, that would be extremely helpful. As for citation, do you mean adding a link to the player's ESPN url in the table? Thanks for the advice. - PoliticalJunkie 01:31, 2 September 2006 (UTC) reply
Just a note. Be careful when harvesting the data from ESPN. If you do it too rapidly to too many entries, they may flag you as a bot and block you. — Ram-Man ( comment) ( talk) 15:30, 2 September 2006 (UTC) reply
Here is an example url: http://sports.espn.go.com/mlb/players/profile?playerId=3392. Thanks for designing the template. If I compiled a dump, would I have to recompile it every day to update the statistics? And, how do I compile a dump? Thanks. - PoliticalJunkie 19:13, 4 September 2006 (UTC) reply
Oh, thanks for the clarification. - PoliticalJunkie 17:53, 5 September 2006 (UTC) reply
The trial, consisting of 19 pages, was successful. See the edits here. - PoliticalJunkie 15:37, 17 September 2006 (UTC) reply
I expect to update baseball players' stats every three days during the season. The baseball season is almost over, so the bot won't operate until next April, when the next baseball season starts.- PoliticalJunkie 17:51, 23 September 2006 (UTC) reply
I just finished programming that into the bot. - PoliticalJunkie 20:11, 29 September 2006 (UTC) reply
Owner | User:PoliticalJunkie |
---|---|
Function | Updating baseball players' stats. |
Language | English |
Program | Pywikipedia framework |
Mode | Starts manually, edits automatically, checked frequently |
Frequency | Every three days |
Thanks. - PoliticalJunkie 23:57, 29 August 2006 (UTC) reply
ESPN.com - PoliticalJunkie 14:30, 30 August 2006 (UTC) reply
It's getting the information by extracting it from ESPN using regex and a preloaded set of player URLs. For example, it takes the player URL as input, goes to that page, and then uses regex to get the necessary statistics. For updating, it's using a search and replace like function. It obtains the table on the page, (which is placed within two tags, see here for a sample edit), and then replaces it with the new, updated statistics. - PoliticalJunkie 17:29, 31 August 2006 (UTC) reply
Okay. - PoliticalJunkie 14:57, 1 September 2006 (UTC) reply
Just looking at Mark Teixeira, I have a couple of questions. Can this information be cited? Have you considered putting the information in the form of a template with the data as parameters? It would make updating it much easier, and you wouldn't need the <!--Please leave this tag here.--> markers. That would also make the bot less likely to make mistakes, since I don't think that tag is generic enough and it's easy to vandalize. If it were a template, you could also add an optional field for a reference. It shouldn't be hard to do. BTW, I think this is a great idea. — Ram-Man ( comment) ( talk) 23:12, 1 September 2006 (UTC) reply
I did consider putting it into a template, but couldn't because I don't know anything about template syntax. I was looking at Wikipedia:Template namespace to see how to accept parameters, but I don't know how to output them in table form. If you could design one using the fields on Mark Teixeira's page, that would be extremely helpful. As for citation, do you mean adding a link to the player's ESPN url in the table? Thanks for the advice. - PoliticalJunkie 01:31, 2 September 2006 (UTC) reply
Just a note. Be careful when harvesting the data from ESPN. If you do it too rapidly to too many entries, they may flag you as a bot and block you. — Ram-Man ( comment) ( talk) 15:30, 2 September 2006 (UTC) reply
Here is an example url: http://sports.espn.go.com/mlb/players/profile?playerId=3392. Thanks for designing the template. If I compiled a dump, would I have to recompile it every day to update the statistics? And, how do I compile a dump? Thanks. - PoliticalJunkie 19:13, 4 September 2006 (UTC) reply
Oh, thanks for the clarification. - PoliticalJunkie 17:53, 5 September 2006 (UTC) reply
The trial, consisting of 19 pages, was successful. See the edits here. - PoliticalJunkie 15:37, 17 September 2006 (UTC) reply
I expect to update baseball players' stats every three days during the season. The baseball season is almost over, so the bot won't operate until next April, when the next baseball season starts.- PoliticalJunkie 17:51, 23 September 2006 (UTC) reply
I just finished programming that into the bot. - PoliticalJunkie 20:11, 29 September 2006 (UTC) reply