Check-in [6d761f85a8]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Import Google+ communities
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6d761f85a8ad1a7f5a36c4830db028c1b61df6be
User & Date: bernd 2019-03-14 16:32:58
Context
2019-03-14
17:29
Fake signatures fixed check-in: 5af1860582 user: bernd tags: trunk
16:32
Import Google+ communities check-in: 6d761f85a8 user: bernd tags: trunk
2019-03-13
22:35
Bump version number check-in: 03ba7f6a7b user: bernd tags: trunk, 0.8.8-20190313
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to do.

1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

echo "This script builds net2o from scratch"

GFORTH=gforth-0.7.9_20190307

if [ "$(uname -o)" = "Cygwin" ]
then
    CONFOPT="--prefix=/usr $*"
else
    CONFOPT="$*"
fi




|







1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

echo "This script builds net2o from scratch"

GFORTH=gforth-0.7.9_20190313

if [ "$(uname -o)" = "Cygwin" ]
then
    CONFOPT="--prefix=/usr $*"
else
    CONFOPT="$*"
fi

Changes to dvcs.fs.

700
701
702
703
704
705
706


707
708

709
710
711
712
713
714
715
...
718
719
720
721
722
723
724
725

726
727
728
729
730
731
732
: .dvcs-log ( -- )
    dvcs:new-dvcs >o  config>dvcs
    project:project$ $@ @/ 2drop 2dup load-msg
    config:logsize# @ display-logn
    dvcs:dispose-dvcs o> ;

also net2o-base


: (dvcs-newsentry) ( type -- )
    dvcs:type !

    msg-group$ @ >r
    project:project$ @ msg-group$ !
    o [: with dvcs
	project:chain$ $@ base85>$
	fileref[]
	message$   $@
	type       @
................................................................................
	id$        $@
	project:branch$ $@
	endwith
	$, msg-tag
	$, msg-id
	dup >r
	dup IF  $, msg-re     ELSE  2drop  THEN
	dup >r dup IF  $, ulit, msg-object  ELSE  2drop drop  THEN

	r> r> IF   IF  "Patchset"  ELSE  "Revert"  THEN
	ELSE  drop "Snapshot"  THEN  $, msg-action
	$, msg-text
	dup [: [: ." file:" forth:type ;] $tmp $, msg-url ;] $[]map $[]free
	dup IF  $, msg-chain  ELSE  2drop  THEN
    ;] (send-avalanche) IF  .chat  ELSE   2drop  THEN
    r> msg-group$ ! ;







>
>


>







 







|
>







700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
...
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
: .dvcs-log ( -- )
    dvcs:new-dvcs >o  config>dvcs
    project:project$ $@ @/ 2drop 2dup load-msg
    config:logsize# @ display-logn
    dvcs:dispose-dvcs o> ;

also net2o-base
true Value add-object?

: (dvcs-newsentry) ( type -- )
    dvcs:type !
    dvcs:hash$ $@len 0= ?EXIT
    msg-group$ @ >r
    project:project$ @ msg-group$ !
    o [: with dvcs
	project:chain$ $@ base85>$
	fileref[]
	message$   $@
	type       @
................................................................................
	id$        $@
	project:branch$ $@
	endwith
	$, msg-tag
	$, msg-id
	dup >r
	dup IF  $, msg-re     ELSE  2drop  THEN
	dup >r dup IF  $, ulit, msg-object
	ELSE  2drop drop  THEN
	r> r> IF   IF  "Patchset"  ELSE  "Revert"  THEN
	ELSE  drop "Snapshot"  THEN  $, msg-action
	$, msg-text
	dup [: [: ." file:" forth:type ;] $tmp $, msg-url ;] $[]map $[]free
	dup IF  $, msg-chain  ELSE  2drop  THEN
    ;] (send-avalanche) IF  .chat  ELSE   2drop  THEN
    r> msg-group$ ! ;

Changes to gui.fs.

645
646
647
648
649
650
651
652
653

654



655
656
657
658
659
660
661
662
...
692
693
694
695
696
697
698

699
700
701
702
703
704
705
706
....
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
	    }}h box[]
	}}z box[]
	{{
	    {{
		glue*ll }}glue
		tex: vp-md
	    glue*l ' vp-md }}vp vp[] dup to project-vp
	    >o font-size# dpy-w @ s>f 25% f* fdup fnegate to borderv f+ to border o o>
	dup font-size# 66% f* fdup vslider }}h box[]

    }}v box[]



}}z box[] to post-frame

: display-file { d: prj -- }
    {{
	glue*l $000000FF color, slide-frame dup .button1
	{{
	    \large whitish prj key| ['] .key-id? $tmp }}text 40%b
	    glue*ll }}glue
................................................................................
    ." open " prj .project cr
    prj 2dup keysize /string [: type '@' emit key| .key-id? ;] $tmp nick>chat
    >dir
    "posts" ~net2o-cache/
    handle-clone
    prj keysize /string set-dir throw
    .project-log next-slide

    project-vp 0.01e [: .vp-top fdrop +sync +resize ;] >animate
    dir> ;

:noname ( -- )
    glue*ll }}glue msg-box .child+
    dpy-w @ 90% fm* msg-par .par-split
    {{ msg-par unbox }}
    dup >r 0 ?DO  I pick box[] "unboxed" name! drop  LOOP  r>
................................................................................
lang:en include-locale lang/en

: ??lang ( addr u -- )
    ['] lang >body find-name-in ?dup-IF  execute  THEN ;

s" LANG" getenv '_' $split 2swap ??lang '.' $split ??lang ??lang

lsids .lsids

[IFDEF] load-cov  load-cov [THEN]

\\\
Local Variables:
forth-local-words:
    (







|

>

>
>
>
|







 







>
|







 







|







645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
...
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
....
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
	    }}h box[]
	}}z box[]
	{{
	    {{
		glue*ll }}glue
		tex: vp-md
	    glue*l ' vp-md }}vp vp[] dup to project-vp
	    >o "project" to name$ font-size# dpy-w @ s>f 25% f* fdup fnegate to borderv f+ to border o o>
	dup font-size# 66% f* fdup vslider }}h box[]
	>o "project-slider" to name$ o o>
    }}v box[]
    >o "project-vbox" to name$ o o>
}}z box[]
>o "project-zbox" to name$ o o>
to post-frame

: display-file { d: prj -- }
    {{
	glue*l $000000FF color, slide-frame dup .button1
	{{
	    \large whitish prj key| ['] .key-id? $tmp }}text 40%b
	    glue*ll }}glue
................................................................................
    ." open " prj .project cr
    prj 2dup keysize /string [: type '@' emit key| .key-id? ;] $tmp nick>chat
    >dir
    "posts" ~net2o-cache/
    handle-clone
    prj keysize /string set-dir throw
    .project-log next-slide
    project-vp 0.01e [: >o vp-top box-flags box-touched# invert and to box-flags o>
	fdrop +sync +resize ;] >animate
    dir> ;

:noname ( -- )
    glue*ll }}glue msg-box .child+
    dpy-w @ 90% fm* msg-par .par-split
    {{ msg-par unbox }}
    dup >r 0 ?DO  I pick box[] "unboxed" name! drop  LOOP  r>
................................................................................
lang:en include-locale lang/en

: ??lang ( addr u -- )
    ['] lang >body find-name-in ?dup-IF  execute  THEN ;

s" LANG" getenv '_' $split 2swap ??lang '.' $split ??lang ??lang

\ lsids .lsids

[IFDEF] load-cov  load-cov [THEN]

\\\
Local Variables:
forth-local-words:
    (

Changes to json/g+-import.fs.

187
188
189
190
191
192
193
194



195
196
197
198
199
200
201
...
294
295
296
297
298
299
300


301
302
303
304
305
306
307
308
...
431
432
433
434
435
436
437

438
439
440
441



442
443
444
445
446
447
448
449
450
451
452

453
454
455
456
457
458
459
460
461
462
463
464
465
466
    ELSE
	." file:" picbase# #@ type
    THEN ;
: .csv-link { d: fn -- }
    ." ![" fn picdesc# #@ .simple-text ." ](file:" fn picbase# #@ type ." )" cr ;
: .media ( -- )
    comments:media{} ?dup-IF cr >o
	." ![" media:description$ .simple-text ." ](" media:url$ .mfile ')' emit cr



	o>  THEN ;
: .album ( -- )
    comments:album{} ?dup-IF cr
	." ::album::" cr cr
	.album:media[] $@ over @ .media:url$
	basedir+name pics# #@ d0= IF
	    bounds U+DO
................................................................................
    ELSE  2drop 2drop  THEN ;

: csv-media ( filename u o:dsvc -- )
    2dup picbase# #@ local-media ;

: add-media { dvcs -- }
    media:localFilePath$ dup IF


	media:url$ basename dvcs .local-media  EXIT
    THEN  2drop
    media:url$ basedir+name pics# #@ d0= IF
	media:contentType$ "image/*" str= IF
	    ." media unavailable: " media:url$ type cr  THEN
	EXIT  THEN
    last# cell+ $@ dvcs .csv-media ;

................................................................................
	    .visibleToStandardAcl:circles[] $@ bounds U+DO
		I @ .circles:displayName$ dup IF
		    [: ." g+:circle:"  type ;] $tmp groups[] $+[]!
		ELSE  2drop  THEN
	    cell +LOOP
	THEN
	groups[] $[]# 0= IF

	    postAcl:isPublic? IF  "g+:<public>"  ELSE  "g+:<private>"  THEN
	    groups[] $+[]!
	THEN
	o>



    THEN
    ['] .plain $tmp $80 umin -trailing-garbage  ['] .project $tmp
    groups[] [: msg-group$ $! 0 .?make-group
	[ also net2o-base ]
	[: 2over $, msg-text 2dup $, msg:project# ulit, msg-object ;]
	[ previous ]
	(send-avalanche) drop msg-group$ $. space .chat ;]
    $[]map  2drop 2drop
    groups[] $[]free ;

: write-out-article ( o:comment -- )

    >dir redate-mode on  comment# off
    dvcs:new-dvcs { dvcs-o }
    comments-base
    2dup [: ." posts/" type ." /.n2o" ;] $tmp ~net2o-cache/..
    ".n2o/files" touch
    dvcs-o >o "g+:" project:project$ $! project:project$ $+!
    "master" project:branch$ $! save-project o>
    dvcs-o add-post
    dvcs-o add-album
    dvcs-o add-poll-photos
    comments:media{} ?dup-IF  >o dvcs-o add-media o>  THEN
    create>never
    ['] .plain $tmp $100 umin -trailing-garbage
    dvcs-o >o pfile$ $@ dvcs:fileref[] $+[]! (dvcs-ci) o>







|
>
>
>







 







>
>
|







 







>
|



>
>
>






|
|
|


>






|







187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
...
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
...
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
    ELSE
	." file:" picbase# #@ type
    THEN ;
: .csv-link { d: fn -- }
    ." ![" fn picdesc# #@ .simple-text ." ](file:" fn picbase# #@ type ." )" cr ;
: .media ( -- )
    comments:media{} ?dup-IF cr >o
	." ![" media:description$ .simple-text ." ]("
	media:url$ 2dup basename nip $100 > IF
	    2drop media:localFilePath$ basename type
	ELSE  .mfile  THEN  ')' emit cr
	o>  THEN ;
: .album ( -- )
    comments:album{} ?dup-IF cr
	." ::album::" cr cr
	.album:media[] $@ over @ .media:url$
	basedir+name pics# #@ d0= IF
	    bounds U+DO
................................................................................
    ELSE  2drop 2drop  THEN ;

: csv-media ( filename u o:dsvc -- )
    2dup picbase# #@ local-media ;

: add-media { dvcs -- }
    media:localFilePath$ dup IF
	media:url$ basename dup $100 > IF
	    2drop media:localFilePath$ basename
	THEN  dvcs .local-media  EXIT
    THEN  2drop
    media:url$ basedir+name pics# #@ d0= IF
	media:contentType$ "image/*" str= IF
	    ." media unavailable: " media:url$ type cr  THEN
	EXIT  THEN
    last# cell+ $@ dvcs .csv-media ;

................................................................................
	    .visibleToStandardAcl:circles[] $@ bounds U+DO
		I @ .circles:displayName$ dup IF
		    [: ." g+:circle:"  type ;] $tmp groups[] $+[]!
		ELSE  2drop  THEN
	    cell +LOOP
	THEN
	groups[] $[]# 0= IF
	    postAcl:isPublic?
	    IF  "g+:<public>"  ELSE  "g+:<private>"  THEN
	    groups[] $+[]!
	THEN
	o>
    THEN
    comments:postKind$ "EXTERNAL_SITE_COMMENT" str= IF
	"g+:external-site-comment" groups[] $+[]!
    THEN
    ['] .plain $tmp $80 umin -trailing-garbage  ['] .project $tmp
    groups[] [: msg-group$ $! 0 .?make-group
	[ also net2o-base ]
	[: 2over $, msg-text 2dup $, msg:project# ulit, msg-object ;]
	[ previous ]
	(send-avalanche) drop msg-group$ $. space
	2dup d0= IF  ." <dupe>" 2drop cr  ELSE  .chat  THEN ;] $[]map
    2drop 2drop  groups[] $[]free ;

: write-out-article ( o:comment -- )
    \ <info> ." write out: " comments:url$ type cr <default>
    >dir redate-mode on  comment# off
    dvcs:new-dvcs { dvcs-o }
    comments-base
    2dup [: ." posts/" type ." /.n2o" ;] $tmp ~net2o-cache/..
    ".n2o/files" touch
    dvcs-o >o "g+:" project:project$ $! project:project$ $+!
    "master" project:branch$ $!  save-project o>
    dvcs-o add-post
    dvcs-o add-album
    dvcs-o add-poll-photos
    comments:media{} ?dup-IF  >o dvcs-o add-media o>  THEN
    create>never
    ['] .plain $tmp $100 umin -trailing-garbage
    dvcs-o >o pfile$ $@ dvcs:fileref[] $+[]! (dvcs-ci) o>

Changes to json/g+-schema.fs.

20
21
22
23
24
25
26

27
28
29
30
31
32
33
cs-scope: g+

object class{ comments
    $value: resourceName$
    $value: url$
    $value: content$
    $value: activityId$

    synonym commentActivityId$ activityId$
    synonym postUrl$ url$ \ comment has postUrl$ instead of url$
    64value: creationTime!
    64value: updateTime!
    value: author{}
    value: album{}
    value: media{}







>







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
cs-scope: g+

object class{ comments
    $value: resourceName$
    $value: url$
    $value: content$
    $value: activityId$
    $value: postKind$
    synonym commentActivityId$ activityId$
    synonym postUrl$ url$ \ comment has postUrl$ instead of url$
    64value: creationTime!
    64value: updateTime!
    value: author{}
    value: album{}
    value: media{}