Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Humanipedia
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module talk:YouTubeSubscribers
(section)
Add topic
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
Add topic
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Design == {{hatnote|Continued from [[wikidata:User talk:BorkedBot#Reference for Twitter followers]], itself continued from [[wikidata:Wikidata:Project chat/Archive/2022/03#social media followers (P8687) was a terrible idea]].}} {{ping|Sdkb}} Moving the discussion here. So a few open questions in the design of this thing: * Do we want to generate a reference in the module? If so to what. BorkedBot currently is not setting references. Maybe that should change. * Do we want to generate the point in time of the data within the module? If so in what format and should it be a separate call to the module or should it return e.g. "1 million as of Jan 5, 2020" * Do we want to format the number in some way. Looking at Wikipedia articles it seems they are formatted in the style of "1 million" or "250 thousand". Should I copy that formatting (or are there already templates to do that and so the logic doesn't need to be in the module). * How should we handle exceptional situations? E.g. sub counts with more than one point in time attached, more than one youtube account associated with the item, negative sub counts, etc. Currently it just returns "?" on failure. Looking forward to getting this in production. [[User:BrokenSegue|''B''roken]][[User talk:BrokenSegue|''S''egue]] 16:07, 17 February 2023 (UTC) :ok so I modified the module to return dates represented as <nowiki>{{Format date|YYYY|mm|dd}}</nowiki>. The number is represented as <nowiki>{{val|count}}</nowiki>. But that's easy to change. I'm currently just failing with error on error conditions. Tell me if this is good enough for you to proceed. I created a test cases page at [[Module talk:YouTubeSubscribers/testcases]]. [[User:BrokenSegue|''B''roken]][[User talk:BrokenSegue|''S''egue]] 02:42, 18 February 2023 (UTC) ::Replying in order: ::#It looks like {{t|Infobox YouTube personality}} already generates a reference to the channel itself, so as far as that application, we're all set. There should absolutely be a reference somehow, since that's a firm requirement of any Wikidata data being used on Wikipedia. ::#The infobox currently has {{para|subscriber_date}} as a separate parameter from {{para|subscribers}}, so it'd be easiest for me to work with a separate call. That way, I can just edit the infobox to replace the parameters with calls to the module. That also seems more flexible for other future use cases. ::#"47 million" is a lot more humanly readable than "47,001,747", so I'd say yes. {{t|Format price}} can be used, I think, even though we're not talking about a price here. As always, flexibility is nice, so if it's possible, it'd be nice to have an option to return a raw number for future use cases where that is desired. ::#Better error handling is always better. At minimum, we'll want it to return {{t|Error}} and link to the module documentation, where we'll explain what the issues might be and teach folks how to get to the Wikidata statement so they can fix them. Ideally, we'd give specific errors that would help folks even more easily implement fixes. ::Regarding the date format of the subscriber count, for the infobox, the documentation currently has it as "Month Year", which seems like a good level of detail to me β specifying the precise day is probably overkill. (It also sidesteps the need to abide by {{t|Use mdy dates}}/{{t|Use dmy dates}}, which is [[Wikipedia:Village_pump_(technical)/Archive_187#Date_formatting_outside_citations|alas currently very difficult]].) For other applications, the precise day might be desired; the format I'd suggest is Y-m-d, which is what the [[WP:CS1|common citation system]] currently defaults to. ::Cheers, <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span>β―<sup>[[User talk:Sdkb|'''talk''']]</sup> 05:58, 21 February 2023 (UTC) :::{{re|Sdkb}} OH so sorry for the lack of response. I don't check my enwiki watchlist very often so pinging me is a good idea. I'll work on these things for delivery by tonight. I'll have my bot start adding references to the subscriber counts. [[User:BrokenSegue|''B''roken]][[User talk:BrokenSegue|''S''egue]] 16:53, 28 February 2023 (UTC) ::::ok. I improved the error messages, changed the number formatting to use <nowiki>{{format price}}</nowiki> (it's now a new command called "subCountNice", see the test cases for examples), truncated the day of month from the date information. Error messages could be more specific but it's probably ok as a start. I really don't know how much expertise with wikidata I should assume Wikipedians have (I assume almost none). Unfortunately there's a lot of ways the lookup can fail and it's hard to provide guidance for every scenario (e.g. what if someone adds two dates to a number of social media followers? do we use the later one? the earlier? error out? skip it? etc). [[User:BrokenSegue|''B''roken]][[User talk:BrokenSegue|''S''egue]] 04:11, 1 March 2023 (UTC) :::::@[[User:BrokenSegue|BrokenSegue]], okay! I just created [[:Category:Pages with YouTubeSubscribers module errors]] so that we'll be able to track where errors show up once this is put into use. Could you get the module to add any pages with errors to it? <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span>β―<sup>[[User talk:Sdkb|'''talk''']]</sup> 05:25, 1 March 2023 (UTC) ::::::Sounds good. I'll try to do that tomorrow. [[User:BrokenSegue|''B''roken]][[User talk:BrokenSegue|''S''egue]] 06:09, 1 March 2023 (UTC) :::::::ok now there are subCountNice and dateNice methods both of which format the outputs nicely and add the page to that category. you can see it in action at [[https://en.wikipedia.org/w/index.php?title=Wikipedia:Sandbox&action=edit&oldid=1142405856]]. [[User:BrokenSegue|''B''roken]][[User talk:BrokenSegue|''S''egue]] 05:56, 2 March 2023 (UTC) ::::::{{re|Sdkb}} Do you need anything from me to move this forward? [[User:BrokenSegue|''B''roken]][[User talk:BrokenSegue|''S''egue]] 00:29, 18 March 2023 (UTC) :::::::@[[User:BrokenSegue|BrokenSegue]], sorry for the delay in following up. I just [https://en.wikipedia.org/wiki/Special:ComparePages?page1=Template%3AInfobox+YouTube+personality&rev1=1144113303&page2=Template%3AInfobox+YouTube+personality%2Fsandbox&rev2=1145354810&action=&unhide=&diffmode=source built out the functionality] in the template sandbox. It was...unfortunately more difficult than anticipated. My initial approach was to invoke the module only if it is error-free, just to be on the safe side, and to otherwise default to the old {{para|subscribers}} parameter. :::::::This worked fine, but when I went to check on some examples from channels I follow, I realized that they quite often had data roughly two years out of date. I don't think this reflects the bot being broken, but rather that the conditions I proposed at [[wikidata:Wikidata:Requests for comment/Frequency of YouTube follower count data|the updating RfC]] had a loophole: If a channel with a WP page isn't growing much, as it seems many aren't these days, it won't be updated until it hits the next 10% threshold, even if that takes years, and even though channels without a WP page are updated yearly. I don't think the editors at e.g. [[PewDiePie]] are going to be happy to see the subscriber count from July 2021 used, even though it's similar to the current one (110M vs. 111M). What I should have proposed is that all items with WP pages be updated at minimum once a year if none of the other conditions are met. :::::::To work around that, I explored having the template try to figure out whether the manually entered data is more recent than the Wikidata-derived data. Here I ran into a second snag, which is that {{t|Infobox YouTube personality}}, as a rather of a rather poor design decision made sometime in the mists of the past, actually has two different ways to specify when the subscriber count was last updated. The first, {{para|subscriber_date}}, applies only to the subscriber count, whereas the second, {{para|stats_update}}, applies to both the subscriber count and to {{para|views}}, the channel's total view count. (The [[:Category:GA-Class YouTube articles|highest-quality/most popular pages on YouTubers]] seem to prefer {{para|stats_update}}.) Trying to parse between three different values to figure out which is valid/most recent and get the template to behave accordingly tied my brain in knots and resulted in a code monstrosity that had at least a few bugs, so I eventually gave up. :::::::It also made me realize that total views is something we should probably be pulling from Wikidata as well. Except...there's not a property for it currently. The closest one is {{wpl|P5436}}, which is different (because it would only count a given viewer once, whereas "views" counts all the video views of a given viewer). So that would need to be created first. :::::::Despite all these snags, I don't want to give up after we've come this far. My impulse is to plunge ahead with the current implementation. This would also allow us to use the tracking category to see how many articles <em>would</em> have errors if we hadn't checked for those, to get a sense of the scale of that problem. If there are complaints, we'll roll back the implementation. Slightly longer-term, we can work toward improving the updating algorithm and fetching the total view count. Once those things are in place and we've minimized the errors, we'll be able to deprecate all the existing parameters around stats updating, which would make the infobox's code a lot simpler. :::::::How does that sound? Sorry for the super long reply haha. And please lmk if any of the above is confusing. Cheers, <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span>β―<sup>[[User talk:Sdkb|'''talk''']]</sup> 19:33, 18 March 2023 (UTC) ::::::::I think actually that **is** what you proposed (it says "update other items once per year"). My reading of the RfC is that we are allowed to update once a year for each account. I just don't have the bot setup to do that. I can do a big run this weekend to update all the old channels. [[User:BrokenSegue|''B''roken]][[User talk:BrokenSegue|''S''egue]] 06:08, 20 March 2023 (UTC) :::::::::Okay, excellent! <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span>β―<sup>[[User talk:Sdkb|'''talk''']]</sup> 13:52, 20 March 2023 (UTC) ::::::::::Ok it's running now to backfill all the missing data. I'll schedule this to happen on a regular basis. Tell me if any are missing once it's done (see [[:wikidata:Special:Contributions/BorkedBot]]). [[User:BrokenSegue|''B''roken]][[User talk:BrokenSegue|''S''egue]] 01:47, 22 March 2023 (UTC) :::::::::::@[[User:BrokenSegue|BrokenSegue]], the module [[Special:Diff/1146164719|is live]]; hurrah! I'm curious to see what will pop up in [[:Category:Pages with YouTubeSubscribers module errors]]. <span style="color:#AAA"><small>{{u|</small><span style="border-radius:9em;padding:0 5px;background:#088">[[User:Sdkb|<span style="color:#FFF">'''Sdkb'''</span>]]</span><small>}}</small></span>β―<sup>[[User talk:Sdkb|'''talk''']]</sup> 04:25, 23 March 2023 (UTC) ::::::::::::so most of the errors are caused by items that are lacking channel IDs on Wikidata. I did see a few where the issue was instead that there were multiple youtube channels and none marked as preferred. I might see if I can find time to go and fix these. [[User:BrokenSegue|''B''roken]][[User talk:BrokenSegue|''S''egue]] 17:18, 23 March 2023 (UTC)
Summary:
Please note that all contributions to Humanipedia may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Humanipedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)