WPAFC / afch

Yet another Articles for creation helper script -- ACTIVE DEVELOPMENT NO LONGER HAPPENS IN THIS REPOSITORY AND HAS MOVED TO
https://github.com/WPAFC/afch-rewrite
9 stars 3 forks source link

Duplication of references #84

Open wikipedia-mabdul opened 11 years ago

wikipedia-mabdul commented 11 years ago

Duplication of references - both in the article as inline reference and the same as listed references under reflist (requested by {{user|TheOriginalSoni}})

theopolisme commented 11 years ago

Unclear; what exactly is @TheOriginalSoni requesting? Could you (TOS) give an example?

Nathan2055 commented 11 years ago

/me whispers that he probably means that if a reference is inline AND in the References section, the one in the section should be nuked.

wikipedia-mabdul commented 11 years ago

exactly. e.g.

Obama is the president of the US and A.<ref>http://whitehouse.gov/</ref>

== References ==
{{Reflist}}
* http://whitehouse.gov/
* foo
* bar
*my grandma
theopolisme commented 11 years ago

It seems to me that this will be fairly difficult to implement successfully without either

Then again, maybe not. I will look at this some more later; @wikipedia-mabdul if you can think of a way to do this efficiently (without a ton of searching...and...regex...and...replacing...and...repeating), i'm all ears :)

wikipedia-mabdul commented 11 years ago

uhm? That isn't that hard: fetching all urls in a ref tag, put them in an array, get list defined urls (* https://foo) and compare them. if identical, then simply remove the "_\s_URL\s*" with ""

theopolisme commented 11 years ago

Yeah, that case isn't difficult – that's what i meant by "only supporting a very limited subset of matches". I was talking about the countless variations on it (like what happens if the urls aren't correctly formatted...or not in ref tags...or not in list...etc).

wikipedia-mabdul commented 11 years ago

this simple mechanism catches ~90% and is very helpful. URLs not correctly formatted? doesn't matter, Shit in, Shit out!

not in ref tags? manual work is needed! Si,So!...

theopolisme commented 11 years ago

"this simple mechanism catches ~90% and is very helpful"... it does? Didn't know we had such sophisticated mental testing facilities ;)

But cool. Go for it, I guess. just watch those milliseconds...

wikipedia-mabdul commented 11 years ago

err, would somebody (@theopolisme) please revert 8141c15854 as this was a) posted to the wrong ticket an b) to the wrong branch...

moreover I only have to figure out how to fill the array correctly... as it doesn't do it at the moment! (https://github.com/WPAFC/afch/commit/9baba3a2b550dc4cbdf9bf143f86ee7331a5b6e8#L0R1059)

theopolisme commented 11 years ago

Moral of this story: don't use the web interface anymore. Geez, be a bit more careful in the future, wouldja ;-)

I won't be able to do this til this evening, sorry.

wikipedia-mabdul commented 11 years ago

a great testcase just imported from enwp to tetstwp (for not getting it deleted!)

https://test.wikipedia.org/wiki/Wikipedia_talk:Articles_for_creation/BuzzMob

if anybody find other great examples, please let me know ;-)

theopolisme commented 11 years ago

Wow, that's......perfect....nice find ;)