Skip to content

Instantly share code, notes, and snippets.

@sago35
Last active March 11, 2024 00:02
Show Gist options
  • Save sago35/5226a83834c33110f312b38ed93679f3 to your computer and use it in GitHub Desktop.
Save sago35/5226a83834c33110f312b38ed93679f3 to your computer and use it in GitHub Desktop.
WRC Switch - EA SPORTS™ WRC
javascript:(function(){var currentUrl=window.location.href.split("?")[0];if(currentUrl.startsWith("https://wrcbuddy.com/static-leaderboard")){var parts=currentUrl.split("/");var selectedLocation=parts[4];var selectedRoute=parts[5];var selectedVehicleClass=parts[6];var selectedSurfaceCondition=parts[7];var racenetUrl="https://racenet.com/ea_sports_wrc/leaderboards/?selectedLocation="+selectedLocation+"&selectedRoute="+selectedRoute+"&selectedSurfaceCondition="+selectedSurfaceCondition+"&selectedVehicleClass="+selectedVehicleClass+"&slot=secondary";window.location.href=racenetUrl;}else if(currentUrl.startsWith("https://racenet.com/ea_sports_wrc/leaderboards")){var params=new URLSearchParams(window.location.search);var selectedLocation=params.get('selectedLocation');var selectedRoute=params.get('selectedRoute');var selectedVehicleClass=params.get('selectedVehicleClass');var selectedSurfaceCondition=params.get('selectedSurfaceCondition');var wrcbuddyUrl="https://wrcbuddy.com/static-leaderboard/"+selectedLocation+"/"+selectedRoute+"/"+selectedVehicleClass+"/"+selectedSurfaceCondition+"/0";window.location.href=wrcbuddyUrl;}else{alert("このページでは利用できません。");}})();
@sago35
Copy link
Author

sago35 commented Mar 10, 2024

※ChatGPT 4 に作ってもらいました

EA SPORTS™ WRC 用です。
実行する毎に、 racenet と wrcbuddy を切り替えます。

@sago35
Copy link
Author

sago35 commented Mar 11, 2024

ブックマークレットの登録方法などはこの辺りから。

https://qiita.com/aqril_1132/items/b5f9040ccb8cbc705d04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment