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

Strip out 'Ask HN', 'Jobs HN' etc #5

Closed
tomspeak opened this Issue Sep 17, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@tomspeak
Owner

tomspeak commented Sep 17, 2017

No description provided.

@tomspeak tomspeak added the bug label Sep 17, 2017

@benhowdle89

This comment has been minimized.

Show comment
Hide comment
@benhowdle89

benhowdle89 Sep 18, 2017

A head start:

package main

import (
    "regexp"
    "fmt"
)

func main() {
    var re = regexp.MustCompile(`(?i)(show|ask) hn`)
    var str = `Show HN: SentinelJS – Detect 
Ask HN: SentinelJS – Detect 
Show hn: SentinelJS – Detect 
ask HN: SentinelJS – Detect `
    
    for i, match := range re.FindAllString(str, -1) {
        fmt.Println(match, "found at index", i)
    }
}

benhowdle89 commented Sep 18, 2017

A head start:

package main

import (
    "regexp"
    "fmt"
)

func main() {
    var re = regexp.MustCompile(`(?i)(show|ask) hn`)
    var str = `Show HN: SentinelJS – Detect 
Ask HN: SentinelJS – Detect 
Show hn: SentinelJS – Detect 
ask HN: SentinelJS – Detect `
    
    for i, match := range re.FindAllString(str, -1) {
        fmt.Println(match, "found at index", i)
    }
}
@benhowdle89

This comment has been minimized.

Show comment
Hide comment
@benhowdle89

benhowdle89 Sep 20, 2017

Actually, just check for the Text key in the JSON response. If it's there, it's not a link, so bin it.

benhowdle89 commented Sep 20, 2017

Actually, just check for the Text key in the JSON response. If it's there, it's not a link, so bin it.

@richarddewit

This comment has been minimized.

Show comment
Hide comment
@richarddewit

richarddewit Oct 18, 2017

One slipped through:

  1. Show HN: Metaballs
    (varun.ca)

richarddewit commented Oct 18, 2017

One slipped through:

  1. Show HN: Metaballs
    (varun.ca)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment