Skip to content

Conversation

@magent-cryptograss
Copy link

Summary

  • Blue Railroad leaderboard configuration now lives on wiki page PickiPedia:BlueRailroadConfig instead of being hardcoded
  • Token pages moved from BlueRailroad:Token_N namespace to main namespace as Blue Railroad Token N
  • Adds SMW namespace config for Cryptograss namespace

Changes

  • Import script reads {{BlueRailroadSource}} and {{BlueRailroadLeaderboard}} templates from config page
  • Multiple leaderboards can be defined with filters (by song_id, owner, etc.)
  • Token pages are now in main namespace (SMW works by default)

Test plan

  • Merge and let Jenkins build
  • Run import script on production: php extensions/SemanticMediaWiki/maintenance/rebuildData.php
  • Run import script: php extensions/BlueRailroadIntegration/maintenance/importBlueRailroads.php
  • Verify SMW properties appear on token pages via Special:Browse
  • Verify Blue Railroad Train page shows recent workouts
  • Delete old BlueRailroad:Token_* pages

The import bot now reads its configuration from PickiPedia:BlueRailroadConfig
wiki page instead of hardcoding leaderboard definitions in PHP.

New features:
- {{BlueRailroadSource}} template defines data sources
- {{BlueRailroadLeaderboard}} template defines pages to generate
- Support for multiple leaderboards with different filters
- Filter by song_id (exercise type) or owner address
- Sort by count, newest, or oldest

Wiki pages created:
- Template:BlueRailroadSource
- Template:BlueRailroadLeaderboard
- PickiPedia:BlueRailroadConfig

This allows wiki editors to add/modify leaderboards without code changes.
Falls back to defaults if config page is missing.
The bot reads raw wikitext, not rendered HTML, so it needs to parse
{{BlueRailroadLeaderboard|...}} syntax directly rather than looking
for hidden markers that only appear after template expansion.
- Token pages now created as "Blue Railroad Token N" instead of
  "BlueRailroad:Token_N"
- Remove namespace setup from README (no longer needed)
- Add SMW namespace config for Cryptograss namespace
- Update leaderboard links to use new page names
Song IDs correspond to track numbers on Tony Rice's 1979 Manzanita album:
- Track 5: Nine Pound Hammer (Pushups)
- Track 7: Blue Railroad Train (Squats)
- Track 8: Ginseng Sullivan (Army Crawls)

Updated example config and documentation to use correct mappings.
Chain data has mixed date formats:
- Newer tokens: YYYYMMDD (e.g., 20260113)
- Older tokens: Unix timestamps (e.g., 1705685808)

Now parses both formats so all tokens get proper Has date minted values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants