~aleteoryx/tclfeed-bsky

ref: 45b4726bb4064d001f09b40b8ecf6a82b6c55ec1 tclfeed-bsky/src/algos/tclposting.tcl -rw-r--r-- 1.2 KiB
45b4726bAleteoryx more heuristic tweaks 25 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
namespace eval ::algos::tclposting {
  variable log [logger::init algos::tclposting]
  proc intake {uri text data} {
    variable log

    # high high confidence strings
    if {[regexp -nocase -- [join {
      {\.tcl}
      {tclsh}
      {tcl-lang}
      {tcltk}
      {tcllib}
      {tklib}
      {tcl\.tk}
      {tcllang}
      {tkinter}
      {tcl/tk}
      {tk/tcl}} | ] $text]} \
    {
      return [dict get $data commit record createdAt]
    }

    # bare minimum
    if {![regexp -nocase -- {\mtcl\M} $text] &&
        ![regexp -- {\mTk\M} $text]} return

    # blocklist
    if {[regexp -nocase -- [join {
      {SYTRAL}
      {F[]te ?des ?Lumi[]res}
      {m[]tro}
      {\mLyon(naise?s?)?\M}
      {TCL\+Ve?Lo?}

      {Wok Mix}

      {youtu\.?be(\.com)[^ ]+(tk|tcl)}

      {Title Tk}
      {Tk (you|DM)\M}
      {Comic-Con Tk}
      {\mtvs?\M}
      {\d\d( ?"|( |-|)in(ch)?)}
      {television}
      {Projector}

      {tcl-bookreviews}
      {TopTenTuesday}

      {DVDVR}
      {wrestling}
      {tk mclaren}} | ] $text]} return

    # "TCL Chinese Theater"
    if {[regexp -nocase -- {chin(a|ese)} $text] &&
        [regexp -nocase -- {theater|movie} $text]} return

    return [dict get $data commit record createdAt]
  }
}