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

refactor: refactor image link handling and add isImageLink function #24

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

kkdai
Copy link
Owner

@kkdai kkdai commented Jan 8, 2024

  • Simplify the image link handling by creating a separate function isImageLink
  • Replace the multiple switch statements with a single if-else statement in GetAllFromURL, Crawler, and GetAllImageAddress
  • Add .jpg extension to image links from https://imgur.com in GetAllFromURL, Crawler, and GetAllImageAddress
  • Remove the unused foundImage variable in GetAllFromURL, Crawler, and GetAllImageAddress
  • Add the isImageLink function to check if a given URL is an image link

- Simplify the image link handling by creating a separate function `isImageLink`
- Replace the multiple `switch` statements with a single `if-else` statement in `GetAllFromURL`, `Crawler`, and `GetAllImageAddress`
- Add `.jpg` extension to image links from `https://imgur.com` in `GetAllFromURL`, `Crawler`, and `GetAllImageAddress`
- Remove the unused `foundImage` variable in `GetAllFromURL`, `Crawler`, and `GetAllImageAddress`
- Add the `isImageLink` function to check if a given URL is an image link

Signed-off-by: Evan Lin <evan.if.lin@linecorp.com>
@kkdai kkdai merged commit 91ce128 into master Jan 8, 2024
1 check passed
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