Jump to content

Module talk:YouTubeSubscribers

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by BrokenSegue (talk | contribs) at 16:53, 28 February 2023 (Design: Reply). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
WikiProject iconYouTube Template‑class
WikiProject iconThis module is within the scope of WikiProject YouTube, a collaborative effort to improve the coverage of YouTube and related topics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
TemplateThis module does not require a rating on Wikipedia's content assessment scale.
WikiProject YouTube To-do:

Here are some tasks awaiting attention:

Design

@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. BrokenSegue 16:07, 17 February 2023 (UTC)[reply]

ok so I modified the module to return dates represented as {{Format date|YYYY|mm|dd}}. The number is represented as {{val|count}}. 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. BrokenSegue 02:42, 18 February 2023 (UTC)[reply]
Replying in order:
  1. It looks like {{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.
  2. The infobox currently has |subscriber_date= as a separate parameter from |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.
  3. "47 million" is a lot more humanly readable than "47,001,747", so I'd say yes. {{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.
  4. Better error handling is always better. At minimum, we'll want it to return {{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 {{Use mdy dates}}/{{Use dmy dates}}, which is 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 common citation system currently defaults to.
Cheers, {{u|Sdkb}}talk 05:58, 21 February 2023 (UTC)[reply]
@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. BrokenSegue 16:53, 28 February 2023 (UTC)[reply]