Code Monkey home page Code Monkey logo

Comments (12)

 avatar commented on September 20, 2024

I finally found how it can be added into the request, as a workaround. In wikidata-edit - lib/request.js:59, replace:
const url = _.buildUrl(base, { action, format: 'json' })
by
const url = _.buildUrl(base, { action, format: 'json', bot: 1 })

from wikibase-cli.

maxlath avatar maxlath commented on September 20, 2024

@Peuc I tried to address this issue by letting the user set a bot=true flag in wikidata-edit via wikidata-cli config: see 058cb49 and maxlath/wikibase-edit@c48021e, could you test it with your bot account? I don't have one so can't make the tests. Suggested steps to test:

cd /tmp
git clone https://github.com/maxlath/wikidata-cli -b botFlags
cd wikidata-cli
npm install
# Re-install wikidata-edit to use the botFlags branch
npm install wikidata-edit@https://github.com/maxlath/wikidata-edit#botFlags
# Use the instance we just installed of wikidata-cli
./bin/wd config bot true
# Trying anything
./bin/wd add-claim Q4115189 P921 Q34679

from wikibase-cli.

 avatar commented on September 20, 2024

Wow, thanks for your patch!
The import to Wikidata is still ongoing, here. It's half done, so it will be finished in about two days.

In order to not interfere in the process, I will test your branch afterwards.

from wikibase-cli.

maxlath avatar maxlath commented on September 20, 2024

ok, keep me updated then :)

from wikibase-cli.

 avatar commented on September 20, 2024

The import is done, I just did some tests of the botFlags branch.
It looks like the bot flag is added, no matter the value of the bot property in config.js (not set/false/true).

from wikibase-cli.

maxlath avatar maxlath commented on September 20, 2024

I tried to fix this issue: maxlath/wikibase-edit@1907bcd
Can you try to update wikidata-edit? simply re-run

npm install wikidata-edit@https://github.com/maxlath/wikidata-edit#botFlags

from wikibase-cli.

 avatar commented on September 20, 2024
$ npm install wikidata-edit@https://github.com/maxlath/wikidata-edit#botFlags
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ [email protected]
added 115 packages and updated 1 package in 12.555s

Exact same behaviour.

I did two checks that may help you:

  • adding delete config.bot into wikidata-edit index.js:13 doesn't help
  • rollback request.js:59 to remove bot actually remove bot flag into commit (yeah, better to double check :) )

from wikibase-cli.

maxlath avatar maxlath commented on September 20, 2024

I refactored a bit wikidata-edit to make it more testable on the bot config behavior, and it now looks like it generates the expected URLs bot flag and body assert parameter, can you confirm?

from wikibase-cli.

 avatar commented on September 20, 2024

Absolutely, this new version works as expected.
Is there a reliable way to auto-detect the bot flag if the bot value is not set in config.json, instead of asserting it's not a bot?

from wikibase-cli.

maxlath avatar maxlath commented on September 20, 2024

I have no idea, I added the assert parameter because, at some point , edits where failing to detect the user who made the edit and I was told that the fix was to use assert=user, but it's not very clear in which case it is or isn't needed. Is the fact that it's not auto-detecting a blocking issue, or would that just be a nice to have?

from wikibase-cli.

 avatar commented on September 20, 2024

This is nowhere near a requirement, the patch fulfills all my needs as it.

Thank you very much for this!

from wikibase-cli.

maxlath avatar maxlath commented on September 20, 2024

you are very welcome :)

from wikibase-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.