Skip to content

Conversation

@DepthStrider-x
Copy link

This PR introduces the following improvements:

  • Added fetch_xml() helper function to handle network errors safely and prevent crashes.
  • Added get_text_or_default() to avoid AttributeError when XML tags are missing.
  • Fixed off-by-one issue in counter logic using enumerate().
  • Removed variable shadowing in loop.
  • Added if __name__ == "__main__" guard to make the script import-safe.

These changes improve reliability and readability without altering the intended functionality of the script.

Removed redundant counter variable and comments in news function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant