~aleteoryx/tclfeed-bsky

ref: c2a8695d26de93111c807e8dd30f111614228c44 tclfeed-bsky/src/algos/tclposting.tcl -rw-r--r-- 930 bytes
c2a8695dAleteoryx oops 26 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
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}} | ] $text]} \
    {
      return [dict get $data commit record createdAt]
    }
    if {![regexp -nocase -- {\mtcl(/tk)?\M} $text] &&
        ![regexp -- {\mTk\M} $text]} return

    if {[regexp -nocase -- [join {
      {Title Tk}
      {Comic-Con Tk}
      {\mtvs?\M}
      {\d\d( ?"|( |-|)in(ch)?)}
      {television}
      {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]
  }
}