Ironholds / WikipediR

R's MediaWiki API client library
Other
68 stars 18 forks source link

Create or edit pages #20

Open nevrome opened 7 years ago

nevrome commented 7 years ago

Any plans to add support for the create and edit capabilities of MediaWiki?

As far as I got it, WikipediR so far only provides methodes to query content - but I would love to have a comprehensive package to also setup and manipulate pages. I guess that could be especially useful for the automatic page creation based on knowledge databases.

I experimented a little bit with the API and httr to write a create function for my own limited purposes. So: If you decide to tackle this, I would be willing to volunteer.

Ironholds commented 7 years ago

Hey! I didn't really have any plans, solely because the authentication method to make it possible and easy is kind of a PITA and super unsafe (transmitting user account and password data through POST query strings). But if you want to branch, build it in and PR, go for it!

nevrome commented 7 years ago

Ok - I see. My test setup allows anonymous editing. The login on the other hand looks complicated.

At the moment I'm not 100% sure where my application is going, but there's a chance, that I finally need user logins via the API. If so, I'll prepare a PR.

Ironholds commented 7 years ago

Yeah, you probably would for the actual release? So, while default-MediaWiki is totally open to anonymous editing a lot of the bigger sites have a load of blockers on anonymous editing that make writing consistently running code for that a pain. Plus from a privacy POV, anonymous editing logs your IP publicly, and I'd be a bad security/privacy/data ethics n erd if I let that be a software library o'mine's default :D

nevrome commented 7 years ago

Here's what I hacked together for my little project. It serves a very specific purpose and I don't know, whether this could be the starting point for a more generic implementation. I guess the login function becomes very complicated, if you try to deal with Second Factor Auth or Captchas...

Ironholds commented 7 years ago

Looks pretty solid! I think(?) API-login is captcha proof and there's still a 2FA-exclusive option.

nevrome commented 7 years ago

@Ironholds Did you see my PR?

Ironholds commented 7 years ago

I did! Sorry, dealing with a load of travel and a CRAN backlog