From 4b2afb47ffdb02146c707afa5266ffc179e24fcb Mon Sep 17 00:00:00 2001 From: b Date: Wed, 13 Jan 2016 20:55:31 +0000 Subject: [PATCH] Changed suggeasted by others; license info git-svn-id: svn://botcastle1b/yplom/facebug1@16 7dec801f-c475-4e67-ba99-809552d69c55 --- bot.1.pl | 366 +++++++++++++++++++++++++++++++++++++++++++++---- config.1.txt | 20 +++ configure.pl | 9 +- if.css | 22 ++- interface.1.pl | 47 +++++-- make.sh | 18 +++ makefile.1.mak | 18 +++ readthis.txt | 2 +- settings | 24 +++- 9 files changed, 486 insertions(+), 40 deletions(-) diff --git a/bot.1.pl b/bot.1.pl index 08eed9c..0223127 100644 --- a/bot.1.pl +++ b/bot.1.pl @@ -1,7 +1,7 @@ ###PERL; # bot is generated from bot.1.pl -# 02.01.2016 +# 13.01.2016 # # This is the facebook bot. It depends on the proxy. # It reads pages from m.facebook.com archived on the proxy, extracts threads, @@ -27,7 +27,7 @@ use Fcntl; use File::Copy; ###PROXY_LIB; ###FACEBUG_LIB; -use proxy_lib qw(url2path urldiv2path path2urldiv getcgi divideurl joinurl readconfigfile entitydecode entityencode urldecode readheaderfile); +use proxy_lib qw(url2path urldiv2path path2urldiv getcgi divideurl joinurl readconfigfile entitydecode entityencode urldecode urlencode readheaderfile); use facebug_lib qw(key readdatafile writedatafile gettimenumber); use POSIX qw(strftime locale_h); @@ -35,6 +35,7 @@ use POSIX qw(strftime locale_h); ###GROUPSETTINGS_PATH; ###KEY_BITS; ###MAX_REDIRECTIONS; +###DETAILED_LOGS; my $time = time(); srand ($time-$$); @@ -299,10 +300,12 @@ sub processfile { my $closetag=0;# if there is a tag to close my $ignoretext;# if text should be ignored and not added to post/thread content my $link; # if bot is inside a link + my $namelink; my $hidename; # if bot is inside a part which contains a name to be hidden my $attnumber; # number of current attachment my $incomplete;# if thread firstpost's content is incomplete my $firstpost; # if the bot is in the firstpost (important if pagetype='post') + my $description; my $content; @@ -411,6 +414,12 @@ sub processfile { # thread author is in first

if (($tag{'<'} eq 'h3') and ($thread{($shared?'shared-':'').'author'} eq '')) { $mode = 'thread-author'; + $link=0; + $namelink=0; + unless ($shared) { + $description=0; + } + $hidename; } # elsif (($tag{'<'} eq 'div')and($tag{'id'} !~ /^ufi_/)) { elsif ($tag{'<'} eq 'div') { @@ -422,6 +431,7 @@ sub processfile { $ignoretext=1; # text in firstposts only inside

$hidename=0; $link=0; + $namelink=0; } # The thread contains "shared" content elsif (($tag{'id'} =~ /^([a-zA-Z0-9]_[a-zA-Z0-9]_[a-zA-Z0-9])$/) and !$shared and ($thread{'shared'} eq '')) { @@ -450,7 +460,7 @@ sub processfile { if (lc($tag{'aria-label'})eq 'likes') { $mode='thread-likes'; } - ###DUPLICADED! + ### this code had to be duplicated: # there is an image attached elsif ($tag{'href'} =~ /^\/photo\.php\?(.*&)?fbid=([0-9]+)(&.*)?$/) { my $imgnum=$2; @@ -499,7 +509,7 @@ sub processfile { $mode = 'thread-attachment-img'; } } - ###END OF DUPLICATED + ###END OF DUPLICATED CODE # there is a link attached elsif ($tag{'href'} =~ /^https?:\/\/([a-z0-9\.\-]+)?facebook\.com\/l\.php\?(.*&)?u=([^&]+)(&.*)?$/) { ++$attnumber; @@ -609,6 +619,10 @@ sub processfile { } } + if ($description <= 0) { + delete $thread{'description'}; + } + # overwrite previous information with new one foreach my $ind (keys %thread) { $thread2{$ind}=$thread{$ind}; @@ -622,8 +636,10 @@ sub processfile { writedatafile($threadfile,%thread2); truncate ($threadfile , tell($threadfile)); - foreach my $ind (keys %thread2) { - print "$ind: $thread2{$ind}\n"; #### + if (DETAILED_LOGS) { + foreach my $ind (keys %thread2) { + print "$ind: $thread2{$ind}\n"; #### + } } print "saved.\n\n"; } @@ -648,19 +664,61 @@ sub processfile { # author name elsif ($mode eq 'thread-author') { # name can be found in hyperlinks - if ($tag{'<'} eq 'a') { + if ($tag{'<'} eq 'span') { + $description=-1; + } + elsif ($tag{'<'} eq 'a') { + if ($tag{'href'} =~ /^https?:\/\/([a-z0-9\.\-]+)?facebook\.com\/l\.php\?(.*&)?u=([^&]+)(&.*)?$/) { + unless ($shared) { + $thread{'description'}.=''; + $link=1; + } + } # there are two types of facebook user IDs - if ($tag{'href'} =~ /^\/([A-Za-z0-9\.]+)\/?(\?.*)?$/) { - my $author = $1; - if ($tag{'href'} =~ /^\/profile\.php\?(.*&)?id=([^&]+)(&.*)?$/) { - $author = urldecode($2); + elsif ($tag{'href'} =~ /^\/([A-Za-z0-9\.]+)\/?(\?.*)?$/) { + my $person = $1; + unless ($person =~ /^(photo|post).php$/) { + if ($tag{'href'} =~ /^\/profile\.php\?(.*&)?id=([^&]+)(&.*)?$/) { + $person = urldecode($2); + } + unless ($shared) { + $thread{'description'}.=''.(($$names{$person} ne '')?$$names{$person}:$$names{'default'}); + $link=1; + $namelink=1; + $hidename=1; + } + + if ($thread{($shared?'shared-':'').'author'} eq '') { + $thread{($shared?'shared-':'').'author'} = $person; + $thread{($shared?'shared-':'').'name'} = ($$names{$person} ne '')?$$names{$person}:$$names{'default'}; + } + } + } + elsif ($tag{'href'} eq '#') { + unless ($shared) { + $thread{'description'}.=''.$$names{'default'}; + $link=1; + $namelink=1; + $hidename=1; } if ($thread{($shared?'shared-':'').'author'} eq '') { - $thread{($shared?'shared-':'').'author'} = $author; - $thread{($shared?'shared-':'').'name'} = ($$names{$author} ne '')?$$names{$author}:$$names{'default'}; + $thread{($shared?'shared-':'').'name'} = $$names{'default'}; } } } + elsif ($tag{'<'} eq '/a') { + if($link) { + if($namelink) { + $thread{'description'}.=''; + $namelink=0; + } + else { + $thread{'description'}.=''; + } + $link=0; + $hidename=0; + } + } # go out of

elsif ($tag{'<'} eq '/h3') { $mode='thread'; @@ -737,14 +795,27 @@ sub processfile { if ($tag{'href'} =~ /^\/profile\.php\?(.*&)?id=([^&]+)(&.*)?$/) { $person = urldecode($2); } - $thread{($shared?'shared-':'').'postcontent'}.=''.(($$names{$person} ne '')?$$names{$person}:$$names{'default'}); + $thread{($shared?'shared-':'').'postcontent'}.=''.(($$names{$person} ne '')?$$names{$person}:$$names{'default'}); + $link=1; + $namelink=1; + $hidename=1; + } + elsif ($tag{'href'} eq '#') { + $thread{($shared?'shared-':'').'postcontent'}.=''.$$names{'default'}; $link=1; + $namelink=1; $hidename=1; } } elsif ($tag{'<'} eq '/a') { if($link) { - $thread{($shared?'shared-':'').'postcontent'}.=''; + if($namelink) { + $thread{($shared?'shared-':'').'postcontent'}.=''; + $namelink=0; + } + else { + $thread{($shared?'shared-':'').'postcontent'}.=''; + } $link=0; $hidename=0; } @@ -757,12 +828,12 @@ sub processfile { elsif ($tag{'<'} eq 'a') { if (($tag{'href'}=~/^\/groups\/$$settings{'id'}\/?\?(.*&)?id=([^&]+)(&.*)?$/) and ($pagetype ne 'thread')) { unless($incomplete) { - $thread{($shared?'shared-':'').'postcontent'}.='

Post not completely archived.

'; + $thread{($shared?'shared-':'').'postcontent'}.='

Post not completely archived.

'; } $incomplete=1; } - ### HAD TO BE DUPLICATED :( + ### this code had to be duplicated: # there is an image attached @@ -969,6 +1040,7 @@ sub processfile { $ignoretext=0; $hidename=0; $link=0; + $namelink=0; } else { ++$level; @@ -1046,8 +1118,10 @@ sub processfile { writedatafile($postfile,%post2); truncate ($postfile , tell($postfile)); - foreach my $ind (keys %post2) { - print "$ind: $post2{$ind}\n"; + if(DETAILED_LOGS) { + foreach my $ind (keys %post2) { + print "$ind: $post2{$ind}\n"; + } } print "saved.\n\n"; } @@ -1230,14 +1304,27 @@ sub processfile { if ($tag{'href'} =~ /^\/profile\.php\?(.*&)?id=([^&]+)(&.*)?$/) { $person = urldecode($2); } - $post{'content'}.=''.(($$names{$person} ne '')?$$names{$person}:$$names{'default'}); + $post{'content'}.=''.(($$names{$person} ne '')?$$names{$person}:$$names{'default'}); + $link=1; + $namelink=1; + $hidename=1; + } + elsif ($tag{'href'} eq '#') { + $post{'content'}.=''.$$names{'default'}; $link=1; + $namelink=1; $hidename=1; } } elsif ($tag{'<'} eq '/a') { if($link) { - $post{'content'}.=''; + if ($namelink) { + $post{'content'}.=''; + $namelink=0; + } + else { + $post{'content'}.=''; + } $link=0; $hidename=0; } @@ -1298,12 +1385,20 @@ sub processfile { $thread{($shared?'shared-':'').'postcontent'}.=$text; } } + if($mode eq 'thread-author') { + unless ($hidename or $shared){ + $thread{'description'}.=$text; + if (($text =~ /[a-z]/) and (!$link) and ($description == 0)) { + $description = 1; + } + } + } # the format facebook uses for showing time is not always helpful (for # example: "2 mins ago") There is no setting to change it in facebook. # at least in the m.facebook.com. The bot corrently DOES NOT interpret the # text. elsif ($mode eq 'thread-time') { - $thread{($shared?'shared-':'').'timetext'}.=$text; + $thread{($shared?'shared-':'').'timetext'}.=facebooktime($timenumber,$text); } elsif ($mode eq 'thread-attachment-link-title') { $thread{($shared?'shared-':'').'linktitle-'.$attnumber}.=$text; @@ -1328,7 +1423,7 @@ sub processfile { } } elsif ($mode eq 'post-time') { - $post{'timetext'}.=$text; + $post{'timetext'}.=facebooktime($timenumber,$text); } elsif ($mode eq 'post-link-title') { $post{'linktitle-'.$attnumber}.=$text; @@ -1472,7 +1567,9 @@ sub saveimg { $archbasepath = urldiv2path($prot, $host, $port, $path, $query); $archheadpath = $archbasepath.'@h'; $archimgpath = $archbasepath.'@v'; - print "url: $url\n"; + if (DETAILED_LOGS) { + print "url: $url\n"; + } # Read the http header. Only interested in the status. If a redirection then # follow it and read again. If 200 it's ok to continue processing. Otherwise # return. @@ -1487,7 +1584,9 @@ sub saveimg { if ($location !~ /^[a-z]+:\/\//) { $location = $prot.'://'.$host.(($port ne '')?(':'.$port):'').$location; } - print "Redirect: $location\n"; + if (DETAILED_LOGS) { + print "Redirect: $location\n"; + } ($prot, $host, $port, $path, $query) = divideurl($location); $archbasepath = urldiv2path($prot, $host, $port, $path, $query); $archheadpath = $archbasepath.'@h'; @@ -1558,3 +1657,220 @@ sub saveimg { return $header{'key'}; } + +# function to get time from facebook time text +# arguments: 1 - time number (when page was downloaded), 2 - facebook time text +# returns a time number on success and the unchanged time text on failure. +sub facebooktime { + (my $timenumber, my $timetext) = @_; + $timetext = lc ($timetext); + + my $year; + my $month; + my $day; + my $hour; + my $minute; + my $ampm; + + my $subtype; + my $subvalue; + my $returnvalue; + + # There are multible possible format of facebook time text format + + # Jan 2 + # January 2 + if ($timetext =~ /^ *([a-z]{3,}) +([0-9]+) *$/) { + $month = $1; + $day = int($2); + $year = int(substr($timenumber,0,4)); + $hour=''; + $minute=''; + } + # Jan 2, 2015 + # January 2, 2015 + elsif ($timetext =~ /^ *([a-z]{3,}) +([0-9]+), +([0-9]{4}) *$/) { + $month = $1; + $day = int($2); + $year = int($3); + $hour=''; + $minute=''; + } + # Jan 2 at 10:02am + # January 2 at 10:02am + elsif ($timetext =~ /^ *([a-z]{3,}) +([0-9]+) +at +([0-9]{1,2}):([0-9]{2})([ap]m) *$/) { + $month = $1; + $day = int($2); + $year = int(substr($timenumber,0,4)); + $hour=int($3); + $minute=int($4); + $ampm=$5; + if($ampm eq 'pm') { + $hour += 12; + } + } + # Jan 2, 2015 at 10:02am + # January 2, 2015 at 10:02am + elsif ($timetext =~ /^ *([a-z]{3,}) +([0-9]+), +([0-9]{4}) +at +([0-9]{1,2}):([0-9]{2})([ap]m) *$/) { + $month = $1; + $day = int($2); + $year = int($3); + $hour=int($4); + $minute=int($5); + $ampm=$6; + if($ampm eq 'pm') { + $hour += 12; + } + } + # 1 hr + # 2 hours ago + # etc... + elsif ($timetext =~ /^ *([0-9]+) +h(ou)?rs?( +ago)? *$/) { + $subtype='h'; + $subvalue=int($1); + $hour = int(substr($timenumber,8,2)); + } + # 4 mins + # 2 minutes ago + # etc... + elsif ($timetext =~ /^ *([0-9]+) +min(ute)?s?( +ago)? *$/) { + $subtype='m'; + $subvalue=int($1); + $minute = int(substr($timenumber,10,2)); + $hour = int(substr($timenumber,8,2)); + } + # 2 days ago + # etc... + elsif ($timetext =~ /^ *([0-9]+) +days?( +ago)? *$/) { + $subtype='d'; + $subvalue=int($1); + } + elsif ($timetext =~ /^ *yesterday +at +([0-9]{1,2}):([0-9]{2})([ap]m) */) { + $subtype='d'; + $subvalue=1; + $hour=int($1); + $minute=int($2); + $ampm=$3; + if($ampm eq 'pm') { + $hour += 12; + } + } + else { + # print "FAIL 1 -".urlencode($timetext)."-\n"; + return $timetext; + } + + if ($year !~ /^[0-9]+$/) { + $year = int(substr($timenumber,0,4)); + } + if ($month !~ /^[0-9]+$/) { + if ($month eq '') { + $month = int(substr($timenumber,4,2)); + } + elsif ($month =~ /^jan/) { + $month=1; + } + elsif ($month =~ /^feb/) { + $month=2; + } + elsif ($month =~ /^mar/) { + $month=3; + } + elsif ($month =~ /^apr/) { + $month=4; + } + elsif ($month =~ /^may/) { + $month=5; + } + elsif ($month =~ /^jun/) { + $month=6; + } + elsif ($month =~ /^jul/) { + $month=7; + } + elsif ($month =~ /^aug/) { + $month=8; + } + elsif ($month =~ /^sep/) { + $month=9; + } + elsif ($month =~ /^oct/) { + $month=10; + } + elsif ($month =~ /^nov/) { + $month=11; + } + elsif ($month =~ /^dec/) { + $month=12; + } + else { + # print "FAIL 2\n"; + return $timetext; + } + + } + if ($day !~ /^[0-9]+$/) { + $day = substr($timenumber,6,2); + } + + if ($subtype eq 'm') { + $minute -= $subvalue; + $subvalue = 0; + while($minute <0) { + $minute += 60; + ++$subvalue; + $subtype = 'h'; + } + } + if ($subtype eq 'h') { + $hour -= $subvalue; + $subvalue = 0; + while($hour <0) { + $hour += 24; + ++$subvalue; + $subtype = 'd'; + } + } + if ($subtype eq 'd') { + $day -= $subvalue; + if ($day <1) { + --$month; + if($month<1) { + --$year; + $month=12; + $day = 31; + } + else { + if ($month == 2) { + if($year%4) { + $day = 28; + } + elsif ($year%100) { + $day = 29; + } + elsif ($year%400) { + $day = 28; + } + else { + $day = 29; + } + } + elsif ((($month%2) and ($month < 8)) or ((!($month%2)) and ($month >= 8))) { + $day = 31; + } + else { + $day = 30; + } + } + } + } + + $returnvalue= sprintf('%04u%02u%02u',$year,$month,$day); + if($hour ne '') { + $returnvalue.=sprintf('%02u',$hour); + if($minute ne '') { + $returnvalue.=sprintf('%02u',$minute); + } + } + return $returnvalue; +} \ No newline at end of file diff --git a/config.1.txt b/config.1.txt index f0ba966..ed26be0 100644 --- a/config.1.txt +++ b/config.1.txt @@ -1,4 +1,24 @@ # config.txt is generated from config.1.txt +# 13.01.2016 +# +# The file with the autogenerated configurations for Apache2 and crontab +# +# Copyright (C) 2015-2016 Balthasar Szczepański +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +# ! the license is for config.1.txt, not config.txt. 8<------------------------------------------------------------------------------ # Copy this to your Apache2 configuration: diff --git a/configure.pl b/configure.pl index bf642c2..c60e97f 100644 --- a/configure.pl +++ b/configure.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # configure.pl -# 02.01.2016 +# 13.01.2016 # # The facebook interface software, when run on a server, will use different # directories, host names, tcp ports, etc. than the server on which this @@ -74,6 +74,13 @@ $def{'HTML_HEAD'} = "use constant HTML_HEAD => '".$set{'html_ $def{'HTML_TOP'} = "use constant HTML_TOP => '".$set{'html_top'}."';"; $def{'HTML_BOTTOM'} = "use constant HTML_BOTTOM => '".$set{'html_bottom'}."';"; +if(($set{'detailed_logs'} eq 'yes') or ($set{'detailed_logs'} =~ /^[0-9]*[1-9][0-9]*$/)) { + $def{'DETAILED_LOGS'} = "use constant DETAILED_LOGS => 1;"; +} +else { + $def{'DETAILED_LOGS'} = "use constant DETAILED_LOGS => 0;"; +} + $def{'PROXY_LIB'} = "use lib '".$set{'proxy_lib_path'}."';"; $def{'FACEBUG_LIB'} = "use lib '".$set{'lib_path'}."';"; diff --git a/if.css b/if.css index a9a955a..b371b98 100644 --- a/if.css +++ b/if.css @@ -1,5 +1,23 @@ -/* It's derived from botm.css, the default style of - 1190.bicyclesonthemoon.info. */ +/* if.css */ +/* 13.01.2016 */ +/* */ +/* The CSS for the facebook interface. It's derived from botm.css, the default*/ +/* style of 1190.bicyclesonthemoon.info. */ +/* */ +/* Copyright (C) 2015-2016 Balthasar Szczepański */ +/* */ +/* This program is free software: you can redistribute it and/or modify */ +/* it under the terms of the GNU Affero General Public License as */ +/* published by the Free Software Foundation, either version 3 of the */ +/* License, or (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Affero General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU Affero General Public License*/ +/* along with this program. If not, see . */ html { diff --git a/interface.1.pl b/interface.1.pl index 31cb963..4b1f198 100644 --- a/interface.1.pl +++ b/interface.1.pl @@ -1,7 +1,7 @@ ###PERL; # interface.pl is generated from interface.1.pl -# 05.01.2015 +# 13.01.2016 # # This is the software of the facebook interface, to access archived groups, # threads, images, etc. @@ -325,8 +325,12 @@ sub showpost { } $$postcontent =~ s/&img([^;]+);/insertimg($1)/ge; print '
'; - print '
'.entityencode($$post{'name'}).(($$post{'timetext'} ne '')?(' • '.$$post{'timetext'}):'').(($$post{'likes'} ne '')?(' • likes: '.$$post{'likes'}.''):'').(($$post{'replies'} ne '')?(' • replies: '.$$post{'replies'}.''):'').'
'."\n"; - print '
'.$$postcontent.'
'."\n"; + print '
'.entityencode($$post{'name'}).(($$post{'timetext'} ne '')?(' • '.showtime($$post{'timetext'})):'').(($$post{'likes'} ne '')?(' • likes: '.$$post{'likes'}.''):'').(($$post{'replies'} ne '')?(' • replies: '.$$post{'replies'}.''):'').'
'."\n"; + print '
'; + if ($$post{'description'} ne '') { + print '

'.$$post{'description'}.'

'; + } + print $$postcontent.'
'."\n"; # "shared post" (post inside a post) if ($$post{'shared'}) { @@ -338,8 +342,12 @@ sub showpost { } $$postcontent =~ s/&img([^;]+);/insertimg($1)/ge; print '
'; - print '
'.entityencode($$post{'shared-name'}).(($$post{'shared-timetext'} ne '')?(' • '.$$post{'shared-timetext'}):'').'
'."\n"; - print '
'.$$postcontent.'
'."\n"; + print '
'.entityencode($$post{'shared-name'}).(($$post{'shared-timetext'} ne '')?(' • '.showtime($$post{'shared-timetext'})):'').'
'."\n"; + print '
'; + if ($$post{'shared-description'} ne '') { + print '

'.$$post{'shared-description'}.'

'; + } + print $$postcontent.'
'."\n"; # shared posts can have attachments too $first=1; @@ -631,10 +639,10 @@ sub thread { # reverse order print '
'; if($rev){ - print ''; + print ''; } else { - print ''; + print ''; } print '
'."\n"; } @@ -843,7 +851,7 @@ sub list { next; } $even = !$even; - print ''.(($group{'name'}ne'')?(entityencode($group{'name'})):$groupid).'
'."\n"; + print ''.(($group{'name'}ne'')?(entityencode($group{'name'})):$groupid).'
'."\n"; } print ''."\n"; @@ -993,7 +1001,7 @@ sub login { } # if password confirmed create the key and the access file - $key=$time.'f'.key(KEY_BITS); + $key=key(KEY_BITS); $accesspath=ACCESS_PATH.$key; open ($accessfile,">",$accesspath) or return loginpage("Couldn't create temporary file $accesspath.","Status: 500 Internal Server Error\n"); @@ -1035,7 +1043,7 @@ sub login { my $dir; print '
'; - print ''; + print ''; print ''; print ''; if ($cgi{'rid'} ne '') { @@ -1235,3 +1243,22 @@ sub getposition { } return; } + +sub showtime { + (my $timetext) = @_; + my $returnvalue; + + if ($timetext =~ /^[0-9]+$/) { + $returnvalue = int(substr($timetext,6,2)).'.'.substr($timetext,4,2).'.'.int(substr($timetext,0,4)); + if (length($timetext) >= 10) { + $returnvalue.= ', '.int(substr($timetext,8,2)); + if (length($timetext) >= 12) { + $returnvalue.= ':'.substr($timetext,10,2); + } + } + } + else { + $returnvalue = $timetext; + } + return $returnvalue; +} diff --git a/make.sh b/make.sh index f584d54..c7f185d 100644 --- a/make.sh +++ b/make.sh @@ -1,8 +1,26 @@ #!/bin/sh +# make.sh +# 13.01.2016 +# # This is the script for making the software. Normally, the makefile is used for # this purpose. But the makefile has to be generated first. # This script generates the makefile and then uses it and finally removes it. +# +# Copyright (C) 2015-2016 Balthasar Szczepański +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . set -x perl configure.pl settings makefile diff --git a/makefile.1.mak b/makefile.1.mak index 33ffcc4..9338aa9 100644 --- a/makefile.1.mak +++ b/makefile.1.mak @@ -1,4 +1,22 @@ # makefile is generated from makefile.1.mak. +# 13.01.2016 +# +# This is the makefile +# +# Copyright (C) 2015-2016 Balthasar Szczepański +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . ###CC; ###CF; diff --git a/readthis.txt b/readthis.txt index 922e9c3..d379c3a 100644 --- a/readthis.txt +++ b/readthis.txt @@ -29,7 +29,7 @@ Run 'make.sh'. It will generate the programs and copy them to the correct location. It will also generate config.txt. Open this file and copy its fragments to your Apache2 config and crontab. -Restart Apache2. (no need for this yet) +Restart Apache2. To add a facebook group: diff --git a/settings b/settings index 2a980cb..615e017 100644 --- a/settings +++ b/settings @@ -1,3 +1,23 @@ +# settings +# 13.01.2016 +# +# In this file are defined values specific for the user's system +# +# Copyright (C) 2015-2016 Balthasar Szczepański +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + #all directory paths must end with '/' and must already exist. bin_path = /yplom/bin/facebug1/ #Where the software will be located @@ -5,7 +25,7 @@ data_path = /yplom/data/facebug1/ #where the software will remember data; subdi #group, groupsettings log_path = /yplom/log/facebug1/ #where the software will remember data tmp_path = /yplom/tmp/facebug1/ #for temporary fies -www_path = /yplom/www/facebug1/ #for the www server unused +www_path = /yplom/www/facebug1/ #for the www server lib_path = /yplom/lib/facebug1/ proxy_bin_path = /yplom/bin/proxy/ #where the proxy software is located @@ -58,3 +78,5 @@ bot_args = 207426296087284 # facebook groups which will be processed by the bot html_top = 1190.bicyclesonthemoon.info
html_bottom =

The facebook interface by Balthasar Szczepański, 2015-2016
Released under the AGPL3 license
The sources and instructions are available here.

1190.bicyclesonthemoon.info html_head = + +detailed_log = no # If the bot should output much details -- 2.30.2