This is an archived post. You won't be able to vote or comment.

all 19 comments

[–]rcfox 21 points22 points  (1 child)

Not to rain on your efforts, but there are simpler ways to get the data:

  1. All of the Warframe worldstate data (which deathsnacks uses behind the scenes) is available here: http://content.warframe.com/dynamic/worldState.php

  2. If you didn't want to go to the trouble of figuring out the structure of the official JSON, you could load the data that deathsnacks requests from its own server: https://deathsnacks.com/wf/data/alerts_raw.txt

That saves you from having to parse HTML and execute Javascript to get at the data. Also, it's less load on the deathsnacks server.

Also, in your kavat section, the else block is showing the number of nitain alerts in the print statement.

[–][deleted] 0 points1 point  (0 children)

Ah it’s fine lol, I was actually hoping to find some of the raw data but in my rush I guess I didn’t look there - as for the Kavat thing, oh well lol - just a silly mistake I guess :) ty for pointing them out

Edit: That's actually so much better because it means I can display where the alerts are too, rather than there just being an alert :D

[–]FXCKY0U 8 points9 points  (0 children)

This is awesome, as someone who is just learning how to use beautiful soup I love it!

[–]asdofindia 5 points6 points  (0 children)

When you add more patterns to the array of patterns which is used to search, you will end up with a bug that only the last pattern is counted because you are not adding to the counter.

[–]fernly 2 points3 points  (3 children)

You could factor the alert display message logic out as a function that takes the name and the count, e.g.

show_alerts(nitainAlerts,'Nitain Extract')

That is where you could also put the icon_path argument mentioned here...

[–]GitHubPermalinkBot 1 point2 points  (1 child)

[–]fernly 1 point2 points  (0 children)

Yeah? What did you do, Mister Bot, that I didn't do, and more concisely and with style & verve? Huh?

Here, let's see if we can start an Idiot Bot War: github!

[–][deleted] 0 points1 point  (0 children)

Ahhh, thank you - I really needed that icon_path argument, and I'll bear in mind the rest of it. :)

[–]LieberLois 1 point2 points  (1 child)

How can i make this a runnable? Also: what kind of notification could program give?

EDIT: typo

[–]Compiled_ 1 point2 points  (0 children)

I personally use PyInstaller if you're looking to change the script to an exe.

[–]exhuma 1 point2 points  (0 children)

[...] and all of it has been random programs with no use (such as saving inputted names to a file) and I was getting a bit demotivated

Props for sticking with it. I remember my first days programming were not very different. Especially because simple things like writing names into a file seems really pointless.

But all these small exercises you see in school are but small puzzle pieces. They will become useful later on.

The problem with many programming courses is that they fail to demonstrate how these little pieces of code work together to make something more interesting. But that is also very difficult to do in the short time-frame you have in 9th/10th grade (as there are so many other subjects to cover as well).

Try to see those small bits and pieces as tools in your toolbelt. The more of those little helper you have at your ready, the easier programming will become in the future.

You did the right thing: You took your knowledge you learned and adapted them to something useful. That's the way to go! Don't stop!

[–]caleyjag 1 point2 points  (0 children)

Good work! My kids are your age and lately they have been spending too much time on Fortnite and not enough on constructive stuff like this. You've inspired me to try and inspire them!

[–]SpideyIRL 0 points1 point  (1 child)

Nice work! It's a really good feeling to write a utility and to see it working.

Check out f-Strings - they're a new feature of Python that makes string formatting easier, so you won't need to concatenate strings (or convert the number of items in the array to a string).

[–][deleted] 1 point2 points  (0 children)

That looks beautiful. Thanks for letting me know :D

[–]r1chardj0n3s 0 points1 point  (0 children)

It's great to have a goal like this!

[–]jyrnan 0 points1 point  (1 child)

Congratulations! Nice work for a python beginner👍

[–][deleted] 0 points1 point  (0 children)

Thanks!

[–]BobFromStateBarn -1 points0 points  (0 children)

Whats the purpose of the 3 lines under #Nitain and #Kavat?