Gets information about the user's stats. Fetched from ScratchDB. Warning: ScratchDB is down indefinitely, therefore this method is deprecated. Returns: dict: A dict containing the user's stats. If the stats aren't available, all values will be -1.
(self)
| 1127 | |
| 1128 | @deprecated("This method is deprecated because ScratchDB is down indefinitely.") |
| 1129 | def stats(self): |
| 1130 | """ |
| 1131 | Gets information about the user's stats. Fetched from ScratchDB. |
| 1132 | |
| 1133 | Warning: |
| 1134 | ScratchDB is down indefinitely, therefore this method is deprecated. |
| 1135 | |
| 1136 | Returns: |
| 1137 | dict: A dict containing the user's stats. If the stats aren't available, all values will be -1. |
| 1138 | """ |
| 1139 | try: |
| 1140 | stats = requests.get(f"https://scratchdb.lefty.one/v3/user/info/{self.username}").json()["statistics"] |
| 1141 | stats.pop("ranks") |
| 1142 | except Exception: |
| 1143 | stats = { |
| 1144 | "loves": -1, |
| 1145 | "favorites": -1, |
| 1146 | "comments": -1, |
| 1147 | "views": -1, |
| 1148 | "followers": -1, |
| 1149 | "following": -1, |
| 1150 | } |
| 1151 | return stats |
| 1152 | |
| 1153 | @deprecated("Warning: ScratchDB is down indefinitely, therefore this method is deprecated.") |
| 1154 | def ranks(self): |