Page 2 of 4

Re: HELP REQUEST FOR SC BOT

Posted: Mon Jul 09, 2018 11:24 am
by Serpent
Ok I just noticed there's a new tag for Slavic. Would it be possible for you to change my items from #sla to #07?
Does the database show anything for Finno-Ugric (#02)?

(also it still says December 2017 on top :D)

Re: HELP REQUEST FOR SC BOT

Posted: Mon Jul 09, 2018 12:29 pm
by rdearman
Serpent wrote:Ok I just noticed there's a new tag for Slavic. Would it be possible for you to change my items from #sla to #07?
Does the database show anything for Finno-Ugric (#02)?

(also it still says December 2017 on top :D)

The dates at the top are hardcoded in the HTML and I didn't bother with that since it doesn't imped the functionality. It needs to be changed so it reads that from the DB also. If anyone is interested in updating the code it is here: https://github.com/language-learners/superchallengebot

hum... Can't change them since they don't exist in the DB. So this will take a little explaining. When the SC started in May 2018, the 2017 version was running on the the server and I couldn't log in to stop it. I created the new 2018 database and started off the collector job and it was collecting all the tweets and putting them into the new DB, but the old one was also running and sticking them into the old DB. So the tweets were going into two different databases. But on the webpage you could see 2017 data and 2018 data. The problem is that the tags being displayed on the site were being taken from the old DB, but didn't exist in the new one. The new collector would have been trying to send you a message saying that doesn't exist and you can't report on it, but the old one accepted it.

There seems to have been a modification to the twitter API done by the company sometime last year which stops the collector from sending you messages. Used to be it would reply with something like "Serpent read X pages in Y language" or "You're not signed up for that language", but because of this API change twitter isn't displaying these messages.

Language families has been a painful hack ever since we tried it out last year. Mostly because of conflicting ISO codes and the fact it wasn't originally designed to be able to handle three character designators. I did seriously consider not allowing language families this year, but because of popular appeal I figure it was ok. If we'd not had this snafu with not being able to modify the DB configuration it would have been OK, because you'd have known the tags which the DB supports.

I will look at your problem and see if I can do a data dump from one DB and an upload into the other. Can you tell me how many records we're talking about? Also if anyone else is having problems with language families could you let me know?

Re: HELP REQUEST FOR SC BOT

Posted: Mon Jul 09, 2018 2:00 pm
by Serpent
I currently have 19 "films" listed as Slovenian (there are a bit more items because not all are 90min long).
I also had 7 Finno-Ugric items.

Re: HELP REQUEST FOR SC BOT

Posted: Wed Jul 11, 2018 6:09 pm
by tiia
Somehow my posts from June are now all missing in the list. There should be 3-4 entries for films after the "first minute"-entry. (I didn't log any reading in June, nor have I logged anything for July yet.)

Re: HELP REQUEST FOR SC BOT

Posted: Sat Jul 14, 2018 7:00 pm
by Serpent
No news about families?
Also, the streaks seem to be broken for me. I've submitted items this week but the streak icon doesn't have a check mark. Perhaps it checks only reading?

tiia wrote:Somehow my posts from June are now all missing in the list. There should be 3-4 entries for films after the "first minute"-entry. (I didn't log any reading in June, nor have I logged anything for July yet.)
was it in the first week of June?

Re: HELP REQUEST FOR SC BOT

Posted: Sat Jul 14, 2018 7:28 pm
by zenmonkey
Ok, looked at the code. (I'm not going to put it in my docker, good god) but here is a quick fix to the issue with #book being confused with #bo for Tibetan:

The fix is adding the term #book to the keyword list. Go to preferences.php and in the line

Code: Select all

public $KEYWORDS = array("#film", "#listen");


change it to:

Code: Select all

public $KEYWORDS = array("#film", "#listen", "#book");


then function keywordExistsAtPosition will return true when called by findHashtagInString and #book won't be considered #bo

edit: one should probably add other keywords like #read, #undo, etc. to that list.

Re: HELP REQUEST FOR SC BOT

Posted: Sat Jul 14, 2018 7:37 pm
by rdearman
zenmonkey wrote:Ok, looked at the code. (I'm not going to put it in my docker, good god) but here is a quick fix to the issue with #book being confused with #bo for Tibetan:

The fix is adding the term #book to the keyword list. Go to preferences.php and in the line

Code: Select all

public $KEYWORDS = array("#film", "#listen");


change it to:

Code: Select all

public $KEYWORDS = array("#film", "#listen", "#book");


then function keywordExistsAtPosition will return true when called by findHashtagInString and #book won't be considered #bo

edit: one should probably add other keywords like #read, #undo, etc. to that list.


Please clone the code, add these items and I'll be happy to review and then publish the code to the bot. Basically this bot (like the forum) is configured to be updated directly from github.

EDIT:

I'm not sure that is the problem, since later in the code you can see that the tags used are:

Code: Select all

        $this->TAGS = array(
            'book' => array("#book","#read"),
            'film' => array("#film","#movie","#watch","#listen","#audio","#radio"));

So it already has book included. Also it recognises #watch for films. So this is the area where it is picking up the hashtags people use. I'll have to dig through the code and figure out which of these arrays it is using to match.

Re: HELP REQUEST FOR SC BOT

Posted: Sat Jul 14, 2018 8:17 pm
by brilliantyears
Serpent wrote:Also, the streaks seem to be broken for me. I've submitted items this week but the streak icon doesn't have a check mark. Perhaps it checks only reading?

My streak was broken too, but that was because of the missing updates from approx. the first week of June. I had a 10 week streak, now down to a 4 week streak...

Re: HELP REQUEST FOR SC BOT

Posted: Sat Jul 14, 2018 8:23 pm
by zenmonkey
rdearman wrote:
zenmonkey wrote:Ok, looked at the code. (I'm not going to put it in my docker, good god) but here is a quick fix to the issue with #book being confused with #bo for Tibetan:

The fix is adding the term #book to the keyword list. Go to preferences.php and in the line

Code: Select all

public $KEYWORDS = array("#film", "#listen");


change it to:

Code: Select all

public $KEYWORDS = array("#film", "#listen", "#book");


then function keywordExistsAtPosition will return true when called by findHashtagInString and #book won't be considered #bo

edit: one should probably add other keywords like #read, #undo, etc. to that list.


Please clone the code, add these items and I'll be happy to review and then publish the code to the bot. Basically this bot (like the forum) is configured to be updated directly from github.

EDIT:

I'm not sure that is the problem, since later in the code you can see that the tags used are:

Code: Select all

        $this->TAGS = array(
            'book' => array("#book","#read"),
            'film' => array("#film","#movie","#watch","#listen","#audio","#radio"));

So it already has book included. Also it recognises #watch for films. So this is the area where it is picking up the hashtags people use. I'll have to dig through the code and figure out which of these arrays it is using to match.


Go to the function findHashtagInString -- it calls keywordExistsAtPosition which uses the array I listed. It checks the language before it uses the code you've posted here.

I've done the clone and created the pull request for you. Best of luck.

Re: HELP REQUEST FOR SC BOT

Posted: Sat Jul 14, 2018 8:31 pm
by Serpent
brilliantyears wrote:
Serpent wrote:Also, the streaks seem to be broken for me. I've submitted items this week but the streak icon doesn't have a check mark. Perhaps it checks only reading?

My streak was broken too, but that was because of the missing updates from approx. the first week of June. I had a 10 week streak, now down to a 4 week streak...
Yeah mine was interrupted too. Now it says I have a four-week streak too but no check mark (here's a profile with a check mark https://super-challenge.language-learne ... e=Anonamul). even though i did tweet items this week and they got successfully registered. let's see whether my streak disappears at midnight UK time.... (or which timezone is the bot in?)