Moved bookmarks to a subdirectory

This commit is contained in:
Eduard Urbach 2019-05-09 08:09:08 +09:00
parent ca1ed36e7b
commit 3923d6bfbf
4 changed files with 31 additions and 29 deletions

View File

@ -77,16 +77,6 @@ docker attach notify.moe
* Make some changes and upload them to your fork.
* Create a pull request on this repository (with the diffs of your fork).
### Bookmark
Create a bookmark in your browser and set this code as the URL:
```js
javascript:(() => )();
```
Clicking this bookmark will let you switch between `notify.moe` (live) and `beta.notify.moe` (development).
## Find us
* [Discord](https://discord.gg/0kimAmMCeXGXuzNF)

View File

@ -73,19 +73,6 @@ docker attach notify.moe
* Make some changes and upload them to your fork.
* Create a pull request on this repository (with the diffs of your fork).
### Bookmark
Create a bookmark in your browser and set this code as the URL:
```js
javascript:(() => {
location = location.href.indexOf('://beta.') === -1 ?
location.href.replace('://', '://beta.') : location.href.replace('://beta.', '://');
})();
```
Clicking this bookmark will let you switch between `notify.moe` (live) and `beta.notify.moe` (development).
## Find us
* [Discord](https://discord.gg/0kimAmMCeXGXuzNF)

14
docs/bookmarks.md Normal file
View File

@ -0,0 +1,14 @@
# Bookmarks
## Live/Dev switcher
Create a bookmark in your browser and set this code as the URL:
```js
javascript:(() => {
location = location.href.indexOf('://beta.') === -1 ?
location.href.replace('://', '://beta.') : location.href.replace('://beta.', '://');
})();
```
Clicking this bookmark will let you switch between `notify.moe` (live) and `beta.notify.moe` (development).

View File

@ -1,28 +1,39 @@
package main
import (
"regexp"
"fmt"
"io/ioutil"
"strings"
"unicode"
"github.com/akyoto/color"
"github.com/animenotifier/arn"
)
var flaggedWords = regexp.MustCompile("fuck|fucking|freaking|shit|bad|terrible|awful|wtf")
func main() {
color.Yellow("Showing user intros")
defer color.Green("Finished.")
defer arn.Node.Close()
data, _ := ioutil.ReadFile("bad-words-list.txt")
fullText := string(data)
badWords := strings.Split(fullText, ",")
for user := range arn.StreamUsers() {
if user.Introduction == "" {
continue
}
if flaggedWords.MatchString(user.Introduction) {
color.Cyan(user.Nick)
color.Red(user.Introduction)
for _, badWord := range badWords {
pos := strings.Index(user.Introduction, badWord)
if pos != -1 && (pos == 0 || !unicode.IsLetter(rune(user.Introduction[pos-1]))) && (pos+len(badWord) == len(user.Introduction) || !unicode.IsLetter(rune(user.Introduction[pos+len(badWord)]))) {
color.Cyan(user.Nick)
color.Red(badWord)
fmt.Println(user.Introduction)
break
}
}
}
}