Skip to content

Commit

Permalink
Merge pull request #41 from Coffee-fueled-deadlines/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Coffee-fueled-deadlines committed Sep 4, 2023
2 parents 58ca0c7 + 7ddaf3e commit 04f4802
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 59 deletions.
6 changes: 5 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# OSRSBytes ChangeLog
## Begin-date: 20191230
## Last-Update: 20230403
## Last-Update: 20230903

[update 20230903]
_Updated OSRSBytes to Version 1.3.2__:
* Implemented a new method of grabbing boss names from the osrs web page that will, hopefully, not require us to manually update the bosses list every time.

[update 20230403]
_Updated OSRSBytes to Version 1.3.1__:
Expand Down
87 changes: 31 additions & 56 deletions OSRSBytes/Hiscores.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
__copyright__ = 'Copyright 2023, CFDeadlines'
__credits__ = ['CFDeadlines (Lead Programmer, Creator)', 'Riley Fitzgibbons (Contributor)']
__license__ = 'EPL-2.0 (https://github.com/Coffee-fueled-deadlines/OSRSBytes/blob/master/LICENSE)'
__version__ = '1.3.1'
__version__ = '1.3.2'
__maintainer__ = {
'CFDeadlines': 'cookm0803@gmail.com',
'Riley Fitz': "rileyfitzgibbons@gmail.com"
Expand Down Expand Up @@ -236,7 +236,9 @@ def __parseBountyHunter(self):
subset = {}
self.__bounty_ranks = [
"hunter",
"rogue"
"rogue",
"hunter_legacy",
"rogue_legacy"
]

for bounty in self.__bounty_ranks:
Expand Down Expand Up @@ -298,63 +300,35 @@ def __parseLMS(self):

self.lms_arenas_sw[self.username] = subset

def __getBossList(self):
"""__getBossList() method
This method functions by getting the HTML of the actual OSRS stat page for a
specific user and under a specific category and table type that'll show all
bosses as they are added. This, in itself, should eliminate the need to
manually update bosses.
"""
uri = "secure.runescape.com"
endpoint = "/m=hiscore_oldschool/overall?category_type=1&table=16&user=hanannie"
conn = http.client.HTTPSConnection(uri)
conn.request("GET", endpoint)
response = conn.getresponse()
response = str(response.read())
split_response = response.split('<span style="color: #d9c27e;display: block;text-align: center;">----</span>')[1]
split_response = split_response.split("</div>")[0]
boss_list_unsanitized = split_response.split("\\n")
boss_list_unsanitized = boss_list_unsanitized[15:]
bosses = []
for boss in boss_list_unsanitized:
if boss:
bosses.append(boss.split("activity-link ",1)[1].split("\">",1)[0])
return bosses


def __parseBosses(self):
subset = {}

self.__bosses = [
"rifts_closed",
"abyssal_sire",
"alchemical_hydra",
"barrows_chests",
"bryophyta",
"callisto",
"cerberus",
"chambers_of_xeric",
"chambers_of_xeric_challenge",
"chaos_elemental",
"chaos_fanatic",
"commander_zilyana",
"corporeal_beast",
"crazy_archaeologist",
"dagannoth_prime",
"dagannoth_rex",
"dagannoth_supreme",
"deranged_archaeologist",
"general_graardor",
"giant_mole",
"grotesque_guardians",
"hesporti",
"kalphite_queen",
"king_black_dragon",
"kraken",
"kreearra",
"kril_tsutsaroth",
"mimic",
"nex",
"nightmare",
"phosanis_nightmare",
"obor",
"phantom_muspah",
"sarachnis",
"scorpia",
"skotizo",
"tempoross",
"gauntlet",
"corrupted_gauntlet",
"theatre_of_blood",
"theatre_of_blood_hard",
"thermonuclear_smoke_devil",
"tombs_of_amascut",
"tombs_of_amascut_expert",
"zuk",
"jad",
"venenatis",
"vetion",
"vorkath",
"wintertodt",
"zalcano",
"zulrah"
]
self.__bosses = self.__getBossList()

for boss in self.__bosses:
for item in self.__parsed_data:
Expand Down Expand Up @@ -385,6 +359,7 @@ def __parseData(self):

# Skip over unused values for most people
self.__parsed_data.pop(0) # Skip over "unknown" (open issue if you know it)
self.__parsed_data.pop(0) # Needed to add another of these for some reason?

self.__parseBountyHunter()
self.__parseClues()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OSRSBytes (v1.3.1)
# OSRSBytes (v1.3.2)
![version](https://img.shields.io/pypi/v/OSRSBytes?style=for-the-badge)
![downloads](https://img.shields.io/pypi/dm/OSRSBytes?style=for-the-badge)<br>
![size](https://img.shields.io/github/languages/code-size/coffee-fueled-deadlines/osrsbytes?style=for-the-badge)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='OSRSBytes_Dev',
version='1.3.0',
version='1.3.2',
author="Coffee Fueled Deadlines",
author_email="cookm0803@gmail.com",
description="An all-in-one OSRS Library with Hiscores and Grand Exchange Market Information",
Expand Down

0 comments on commit 04f4802

Please sign in to comment.