Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed parsing after blizzard change of main div #216

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

TeKrop
Copy link
Owner

@TeKrop TeKrop commented Nov 12, 2024

Summary by Sourcery

Fix parsing logic to handle Blizzard's change in the main content div structure by updating the HTML parser to support both 'div.main-content' and 'main' elements.

Bug Fixes:

  • Fix parsing logic to accommodate Blizzard's change in the main content div structure.

Enhancements:

  • Add support for parsing both 'div.main-content' and 'main' elements in the HTML parser.

@TeKrop TeKrop added bug Something isn't working blizzard-issue Issue coming from Blizzard (wrong data, performance issue, etc.) labels Nov 12, 2024
@TeKrop TeKrop self-assigned this Nov 12, 2024
Copy link
Contributor

sourcery-ai bot commented Nov 12, 2024

Reviewer's Guide by Sourcery

This PR fixes an issue with HTML parsing after Blizzard changed their main div structure. The changes include updating the CSS selector to handle both old and new div structures, bumping the version number, and making some test improvements.

Updated class diagram for the HTML parser

classDiagram
    class HTMLParser {
        - root_tag
        + create_parser_tag(html_content: str)
    }
    note for HTMLParser "Updated to handle both 'div.main-content' and 'main' as root tags"
Loading

File-Level Changes

Change Details Files
Updated HTML parser to handle new Blizzard div structure
  • Modified CSS selector to match both 'main' and 'div.main-content' elements
  • Updated parser tag creation logic to handle the new structure
app/parsers.py
Version bump and test improvements
  • Incremented version from 3.5.0 to 3.5.1
  • Added profiler patch in test configuration
pyproject.toml
tests/conftest.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

sonarcloud bot commented Nov 12, 2024

@TeKrop TeKrop merged commit 9baecbe into main Nov 12, 2024
3 checks passed
@TeKrop TeKrop deleted the bugfix/blizzard-change-main branch November 12, 2024 18:49
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @TeKrop - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Found a Google Tag Manager ID hardcoded in the JavaScript code (link)
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🔴 Security: 1 blocking issue
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-TVHPB9J');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Found a Google Tag Manager ID hardcoded in the JavaScript code

While GTM IDs are not strictly secrets, they are often treated as such since they can be used to inject malicious code if compromised. Consider moving this to a configuration file or environment variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blizzard-issue Issue coming from Blizzard (wrong data, performance issue, etc.) bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant