weblue / wanna_b_tierlist

http://cephalonwannab.com
Apache License 2.0
34 stars 9 forks source link

Adds frame URLs #58

Closed Linked-Liszt closed 4 years ago

Linked-Liszt commented 4 years ago

When you click on the frame links, they redirect back to the main site. Adding the URL's to the list should make them redirect to the wiki.

I wrote a quick python script to add the links automatically. The script outputs the .json indented with spaces, but I used VSCode's convert to tabs feature to turn it back.

Script:

import sys
import codecs
import json

listpath = sys.argv[1]

with codecs.open(listpath, 'r', encoding='utf-8') as list_file:
    list_data = json.load(list_file)

for _, frame_data in list_data['Frames'].items():
    frame_data['url'] = f'http://warframe.wikia.com/wiki/{frame_data["frameName"]}'

with codecs.open(listpath, 'w', encoding='utf-8') as list_file:
    json.dump(list_data, list_file, indent=4, ensure_ascii=False)

Let me know if you guys have any questions or want to make any changes.

Cheers, Oxymoren

mattxwang commented 4 years ago

Hey @sakai4eva just want to check in, have you had a chance to look at this yet?

sakai4eva commented 4 years ago

I'm ok with it, but you need to let me know what is the name of the JSON field to use so that I can add it to my worksheet.

mattxwang commented 4 years ago

I'm ok with it, but you need to let me know what is the name of the JSON field to use so that I can add it to my worksheet.

It's url, under Frames. We had already implemented the Angular code for this somewhere, so I think it got lost in translation.

Should be mostly static, so I can't imagine things changing. Then, when a new frame comes out, the idea is just to add its wiki URL.

mattxwang commented 4 years ago

If that's good I'm going to merge this PR. Thanks for the help @Oxymoren!