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

[Feature]: Ignore StackOverflow comments #16

Closed
gepser opened this issue Aug 8, 2020 · 6 comments
Closed

[Feature]: Ignore StackOverflow comments #16

gepser opened this issue Aug 8, 2020 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed up-for-grabs

Comments

@gepser
Copy link

gepser commented Aug 8, 2020

Is your feature request related to a problem? Please describe.
When you have an answer or a question it's usually the case where you have many comments too, so you only want to show the question or the answer.

Describe the solution you'd like
StackOverflow comments should not appear at all.

Describe alternatives you've considered
Maybe a filter for show/display them.

Additional context
Think like this but for StackOverflow #4.

p.s. I'd be happy to implement the solution and send a PR if you let me do it that.

@gepser gepser added the enhancement New feature or request label Aug 8, 2020
@gautamkrishnar gautamkrishnar added help wanted Extra attention is needed up-for-grabs labels Aug 9, 2020
@gautamkrishnar
Copy link
Owner

gautamkrishnar commented Aug 9, 2020

This is released now: https://github.com/gautamkrishnar/blog-post-workflow/releases/tag/1.1.5 and enabled by default

@gepser
Copy link
Author

gepser commented Aug 10, 2020

Thanks @gautamkrishnar !

Two improvements if I'm allowed to suggest:

  1. Add the stackexchange domain as one of the supported sites for the filtered comments.

  2. Remove the validation of the author && item.title.startsWith('Comment by ' + item.author)); so any StackOverflow in any language works.

You can see this suggestions would fix the last two sections here https://github.com/gepser/gepser

May I open another issue or send a PR?

Thanks

@gautamkrishnar
Copy link
Owner

gautamkrishnar commented Aug 10, 2020

@gepser

  1. Add the StackExchange domain as one of the supported sites for the filtered comments

This one is doable

  1. Remove the validation of the author && item.title.startsWith('Comment by ' + item.author)); so any StackOverflow in any language works.

sorry, I don't think that this would be possible. How can we differentiate between comments and normal posts then? If you remove it the filter would be:

const ignoreStackOverflowComments = (item) => !(COMMENT_FILTERS.indexOf('stackoverflow') !== -1 && item.link.includes('stackoverflow.com'));

This will always return true. So no filtering would happen. Please let me know if you have any solution for this.

@gepser
Copy link
Author

gepser commented Aug 10, 2020

sorry, I don't think that this would be possible. How can we differentiate between comments and normal posts then?

You are right, I didn't see that.

Maybe a solution can be sending the Comment by as an optional parameter so people can use it in any StackOverflow language (Japanese, Russian, Portuguese, Spanish) or more general the filter string as a parameter so you can filter questions and comments but show only answer for example.

Any thoughts on that?

@gautamkrishnar
Copy link
Owner

gautamkrishnar commented Aug 10, 2020

@gepser you can now use the following format to customize your filter to use spanish for stackoverflow and stackexchange:

name: Latest Spanish StackOverflow Contributions
on:
  schedule:
    # Runs every hour
    - cron: '0 * * * *'
  workflow_dispatch:

jobs:
  update-readme-with-es-stackoverflow:
    name: Update this repo's README with latest contributions from Spanish StackOverflow
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: gautamkrishnar/blog-post-workflow@master
        with:
          filter_comments: "stackoverflow/Comentario de $author/"
          comment_tag_name: "SPANISH-STACKOVERFLOW"
          feed_list: "https://es.stackoverflow.com/feeds/user/399"
          max_post_count: 3

gepser added a commit to gepser/gepser that referenced this issue Aug 10, 2020
@gepser
Copy link
Author

gepser commented Aug 10, 2020

Incredible! Thank you very much!

I also added the filter on the stackexchange site as you can see here.

Here is the result:

Before:

image

After (only answers and questions):

image

Thanks again @gautamkrishnar ! I appreciate the work you did here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed up-for-grabs
Projects
None yet
Development

No branches or pull requests

2 participants