gautamkrishnar / blog-post-workflow

Show your latest blog posts from any sources or StackOverflow activity or Youtube Videos on your GitHub profile/project readme automatically using the RSS feed

Home Page:https://github.com/marketplace/actions/blog-post-workflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature]: Ignore StackOverflow comments

gepser opened this issue · comments

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.

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

@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.

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?

@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

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!