Skip to content

GFGScraper Implementation#36

Open
Louser21 wants to merge 1 commit into
ashish-066:mainfrom
Louser21:feat/gfgScrapper
Open

GFGScraper Implementation#36
Louser21 wants to merge 1 commit into
ashish-066:mainfrom
Louser21:feat/gfgScrapper

Conversation

@Louser21

@Louser21 Louser21 commented Jun 4, 2026

Copy link
Copy Markdown
  1. Lightweight Parsing Strategy (GfgClient.java):
    Instead of spinning up a memory-heavy headless browser (e.g., Playwright) that causes server crashes in low-memory environments, we implemented a dual-mode parser using Jsoup:

    • JSON Fallback: Extracts embedded server-side serialized JSON structures (e.g., total_problems_solved and streak metrics) directly from modern Next.js GFG profiles.
    • DOM Fallback: Uses regex on plain text for older DOM structures.
    • Topic/Skill Scanner: Identifies skills like Java, C++, and Python by reading the raw HTML body.
  2. Backend & Controller Integration (PlatformSyncService.java, PlatformVerificationController.java):

    • Hooked GfgClient into the platforms map, enabling automated batch syncing for GeeksforGeeks accounts.
    • Enabled "gfg" on the verification /start endpoint. Since GFG doesn't expose clean public submission feeds, it returns autoVerify: true if the profile exists, skipping the manual task-solving step.
  3. Frontend Integration (OnboardingPage.jsx, ProfilePage.jsx, api.js):

    • Added GFG configuration metadata (color: #2E8B57, placeholder, logo badge) to both the Onboarding wizard and the User Profile view.
    • Fixed a frontend mapping bug in api.js to ensure the autoVerify boolean gets passed to the UI components.
  4. Security & Session Bugfix (JwtAuthFilter.java):

    • Fixed a critical auth loop blocker. If the browser had an expired or invalid cookie, JwtAuthFilter was rejecting all requests with a 401, preventing users from logging in or registering. The filter now allows requests to public endpoints (like /auth/generateToken and /auth/signup/*) to bypass verification errors anonymously.
  5. Local Cleanup:

    • Reverted the temporary H2 database changes to keep the original PostgreSQL configuration intact.
    • Removed all debug helper methods and scratch testing files (nikhil.html, gfg_script.txt, etc.) to keep the pull request 100% clean.

Issue #2

@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the ashishkaranam06-9122's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Louser21

Louser21 commented Jun 4, 2026

Copy link
Copy Markdown
Author

@ashish-066 Please check the changes and ping me if further changes are required

@ashish-066

Copy link
Copy Markdown
Owner

did you test the changes

@Louser21

Louser21 commented Jun 4, 2026

Copy link
Copy Markdown
Author

I tested the backend with 3 of my IDs and the frontend itself works fine

If you are expecting something else we can add that coz we got all the data

@ashish-066

ashish-066 commented Jun 4, 2026

Copy link
Copy Markdown
Owner

If you are expecting something else we can add that coz we got all the data
what are all the data you are getting ?can you attach some pic of all the data you are receiving

@Louser21

Louser21 commented Jun 4, 2026

Copy link
Copy Markdown
Author

Well we can get the heatmap if submission and user related details like dob and stuff

But ig heatmap is the only thing we could add

@ashish-066

Copy link
Copy Markdown
Owner

i didnt get you.

@Louser21

Louser21 commented Jun 4, 2026

Copy link
Copy Markdown
Author

😭😭
I am trying to say that
Do you see a chart when you see a CF profile that shows submissions every day

Well even gfg shows that chart on user profile so we can fetch that chart data and then showcase in your app

I can't explain any better 💔😭

@ashish-066

ashish-066 commented Jun 4, 2026

Copy link
Copy Markdown
Owner

you think the person who made this thing doesn't know what a heatmap means?i am asking what do you mean by other stuff.put it perfectly.before i test it i atleast need to be sure that you are getting the data correctly.mention what all data you are getting

@Louser21

Louser21 commented Jun 4, 2026

Copy link
Copy Markdown
Author

Here they are,
Heatmap
User details (dob,location,college)
Questions attempted/submitted

I have added the xtra ones like easy question attempted,hard ones attempted,medium ones attempted

Current Streak,longest streak , total solved

You can choose the changes you want

@ashish-066

Copy link
Copy Markdown
Owner

can you attach the results for the tests you done

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.

2 participants