Author Topic: Script for egafd.com  (Read 100153 times)

0 Members and 1 Guest are viewing this topic.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2667
    • View Profile
Re: Script for egafd.com
« Reply #80 on: December 20, 2011, 01:15:59 pm »
Will this be something to help.

For TabBirthDay

Code: [Select]
TabBirthDay := ['1860', '1861', '1862', '1863', '1864', '1865', '1866', '1867', '1868', '1869'
                , '1870', '1871', '1872', '1873', '1874', '1875', '1876', '1877', '1878', '1879'
                , '1980', '1981', '1982', '1983', '1984', '1985', '1986', '1987', '1988', '1889'
                , '1890', '1891', '1892', '1893', '1894', '1895', '1896', '1897', '1898', '1899'
        , '1900', '1901', '1902', '1903', '1904', '1905', '1906', '1907', '1908', '1909'
                , '1910', '1911', '1912', '1913', '1914', '1915', '1916', '1917', '1918', '1919'
                , '1920', '1921', '1922', '1923', '1924', '1925', '1926', '1927', '1928', '1929'
                , '1930', '1931', '1932', '1933', '1934', '1935', '1936', '1937', '1938', '1939'
                , '1940', '1941', '1942', '1943', '1944', '1945', '1946', '1947', '1948', '1949'
                , '1950', '1951', '1952', '1953', '1954', '1955', '1956', '1957', '1958', '1959'
                , '1960', '1961', '1962', '1963', '1964', '1965', '1966', '1967', '1968', '1969'
                , '1970', '1971', '1972', '1973', '1974', '1975', '1976', '1977', '1978', '1979'
                , '1980', '1981', '1982', '1983', '1984', '1985', '1986', '1987', '1988', '1989'
                , '1990', '1991', '1992', '1993', '1994', '1995', '1996', '1997', '1998', '1999'
, 'exit'];

Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2667
    • View Profile
Re: Script for egafd.com
« Reply #81 on: December 20, 2011, 02:26:50 pm »
For DeathDate

Code: [Select]
posBorn, Country, Birthday, DeathDate : string;
and

Code: [Select]
  /// DeathDate:

ExplodeString(Born, PartBorn, #46);

If High(partBorn) > 0 then
Begin
  logmessage('deathday commence')
    For I := Low(partBorn) to High(partBorn) do
    Begin
    PartBorn[I] := Trim(partBorn[I]);
    End;

For I := Low(partBorn) to High(partBorn) do
Begin
If (Lowercase(partBorn[I]) = 'd') OR (Copy(partBorn[I], length(partBorn[I])-2,3) = ', b') then
     DeathDate := '28/12/' + Copy(partBorn[I+1], 0, 4);
end;
end;

If DeathDate <> '' then AddFieldValue(pfDeathDate, DeathDate);


For me it works, but incorrect.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline pra15

  • Older Power User
  • *****
  • Posts: 173
    • View Profile
Re: Script for egafd.com
« Reply #82 on: December 20, 2011, 02:34:00 pm »
I'm getting in the muddle with all versions of egafd and all correction!  >:(

For this :
Code: [Select]
AddFieldValue(pfGenre, 'EGAFD');
I made this just for me, because i use iafd too and this can allow to sort more easily my list of actors.

I have the same version 9.9.21, but you resolved your problem so it's Ok;

I don't understand very well why you want to add birthday to the birthplace, the data is already in the field Birthday, if you think it's better, ok!

I'm trying to see if we can avoid adding links of movies in the filmography if the movie is already in the PVD database.

I'll see death  :'( later.

I don't understand very well this :
Would be found to regulate  egafd movie script  that may be looking for movie titles the same way as in  egafd  people  script .

Sorry, you should write to me like a baby  :-[


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2667
    • View Profile
Re: Script for egafd.com
« Reply #83 on: December 20, 2011, 04:03:57 pm »
Quote
I made this just for me, because i use iafd too and this can allow to sort more easily my list of actors.

OK, now I understand,

Quote
I don't understand very well why you want to add birthday to the birthplace, the data is already in the field Birthday, if you think it's better, ok!

This will only be with me, in the final version, which will be accessible to all, will like this

Quote
the data is already in the field Birthday

as was mentioned and it is right that such remains.

I agree, but I think you got the same opinion.

Quote
I don't understand very well this :
Would be found to regulate  egafd movie script  that may be looking for movie titles the same way as in  egafd  people  script .

I wanted to say as follows:
If you have the title of the film and no other data in the PVD database that it could be the egafd movie script through the search results find the url and other info data for such a movie title.

Quote
Sorry, you should write to me like a baby

I do not understand this.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline pra15

  • Older Power User
  • *****
  • Posts: 173
    • View Profile
Re: Script for egafd.com
« Reply #84 on: December 20, 2011, 04:31:06 pm »
Ok, i understand but i'm just seeing that my fonction of search in egafd_people doesn't works now!
And with this method, the title must be exactly the same, i'm not sure that's is more simple to search directly in the site egafd, but i'll try makes search for tilte after seen my problem in egafd_people!

a baby! because my english is approximative and sometimes it could makes somes confusions or misunderstanding, so if you could be most simply possible, that's all!
« Last Edit: December 20, 2011, 04:34:14 pm by pra15 »

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2667
    • View Profile
Re: Script for egafd.com
« Reply #85 on: December 20, 2011, 04:49:27 pm »
Quote
a baby! because my english is approximative and sometimes it could makes somes confusions or misunderstanding, so if you could be most simply possible, that's all!

OK, he is best expressed in its Slovenian language, for translation into English using Google Translate.
If anything helps when I next added a reply, this also in my own language.
(Če kaj pomaga, ko bom naslednjič dodal reply,
bo ta  tudi v mojem jeziku.)

Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline pra15

  • Older Power User
  • *****
  • Posts: 173
    • View Profile
Re: Script for egafd.com
« Reply #86 on: December 20, 2011, 11:03:39 pm »
Me, i use a dictionary!

I looked my search function and i didn't find the error!
Somes page works but if there's no 'notes' like this it not works:
http://www.egafd.com/actresses/details.php/id/n00008

The prlist is good but the script stop after have choosen a name.
I don't understand why!

I added an if pos('<th>Notes</th>', HTML) > 0 then begin in parsepeople before using this part of the page but doesn't work.

If you have an idea?

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2667
    • View Profile
Re: Script for egafd.com
« Reply #87 on: December 20, 2011, 11:57:46 pm »
http://www.egafd.com/actresses/details.php/id/n00008

Works a bit slower but it works for me.

Quote
I added an if pos('<th>Notes</th>', HTML) > 0 then begin in parsepeople before using this part of the page but doesn't work.

Perhaps what this helps

Code: [Select]
//---------------------- Parse Page -------------------------
// ParsePage
// - Entrypoint for the script. Check if the search-term leads to zero, one or many results.
function ParsePage(HTML : String; URL : AnsiString) : Cardinal;
var NomTitle : string;

begin

NomTitle := '<title>' + RealName + '</title>'; //Valeur Titre dans la page de l'actrice

//Choix suivant page chargée


If Pos('<title>Actresses:', HTML) > 0 then begin //Si page index actrices
SearchResults(HTML); //Appel de la fonction recherche dans page index
Result := prList; //Résultat de la recherche
end else
If Pos('<title>Actresses:', HTML) < 0 then begin
LogMessage('Erreur...');
Result := prError; //error (actrice non trouvée)
end
else
//Page actrice
If Pos('<th>Notes</th>', HTML) > 0 then begin //Si page actrice
Mode := smNormal;
ParsePeople(URL, HTML); //Recherche des infos
Result := prDownload; //Récupérer les données
end
else
If Pos('<th>Pseudonyms</th>', HTML) > 0 then begin //Si page actrice
Mode := smNormal;
ParsePeople(URL, HTML); //Recherche des infos
Result := prDownload; //Récupérer les données
end
else
If Pos('<th>Films</th>', HTML) > 0 then begin //Si page actrice
Mode := smNormal;
ParsePeople(URL, HTML); //Recherche des infos
Result := prDownload; //Récupérer les données
end else
Result := prError; //erreur (page non trouvée)

end;

//-----------------------Initialisation du script-----------------

begin
 Mode := smSearch;   //Mode d'initialisation du script
end.

He also added the full script for the help.

[attachment deleted by admin]
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline pra15

  • Older Power User
  • *****
  • Posts: 173
    • View Profile
Re: Script for egafd.com
« Reply #88 on: December 21, 2011, 06:49:08 am »
You're script doesn't work for me!

With what name ('title') did you make search : segaug, nicole segaud.....
Have you remove url before search?

I don't understand!

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2667
    • View Profile
Re: Script for egafd.com
« Reply #89 on: December 21, 2011, 07:33:00 am »
You're script doesn't work for me!

With what name ('title') did you make search : segaug, nicole segaud.....
Have you remove url before search?

I don't understand!

It is true that this segaug, nicole segaud.....  does not work, but Nicole Segaud would like it should work. Pictures attached.

Script does not work for all or only at this address. With me this script works perfectly, no major problems with what the title might work more slowly but it works.

[attachment deleted by admin]
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline pra15

  • Older Power User
  • *****
  • Posts: 173
    • View Profile
Re: Script for egafd.com
« Reply #90 on: December 21, 2011, 07:53:09 am »
So, it's not 'Notes' who is in cause.
The name in the title must be exactly the same as in the web page for working.

But if i use Nicole Segaud, i don't obtain like your sshot2.png, a prlist, the good web page is directly get.

I don't know if it's possible to change title (putting the real name), during the script after choosing a line in the prlist and before getting web page.
I don't know if i'm clear.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2667
    • View Profile
Re: Script for egafd.com
« Reply #91 on: December 21, 2011, 08:21:22 am »
Quote
I don't know if it's possible to change title (putting the real name), during the script after choosing a line in the prlist and before getting web page.

Not I know this may be what help you:
КиноПоиск.Ru for movie
КиноПоиск.Ru for people
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline pra15

  • Older Power User
  • *****
  • Posts: 173
    • View Profile
Re: Script for egafd.com
« Reply #92 on: December 21, 2011, 05:01:52 pm »
I modified SearchResults :

Before, as i declare RealName only in searchResults delete :
RealName := NomAct; (in getDownloadURL)
Montitle := ...... (in parsepage)

Code: [Select]
procedure SearchResults(HTML : string);

///////////////////////////////////////////////////////////////////////////////////////////
var curpos,endpos, counter : Integer; //
    actPosStart, actPosEnd, actalposStart, actalposEnd, urlPosStart, urlposEnd : integer;//
    beforeName, URLTemp, AliasName, NameTemp, RealName : string; //
///////////////////////////////////////////////////////////////////////////////////////////

Begin

//Méthode 2 Nom ou Pseudo
Curpos := Pos(nomAct, HTML);

If curpos > 0 then begin

endPos := curpos;
 
While (curpos > 0) AND (curpos < PosFrom('<h2 class="index">Actress:', HTML, Endpos)) do begin
endpos := curpos;

actPosStart:= PrevPos('>', HTML, curpos);
actPosEnd := Posfrom('</', HTML, actposStart);
NameTemp := Trim(Copy(HTML, actPosStart+1, (actPosEnd-actPosStart-1)));
LogMessage('NameTemp :' + NameTemp);
beforeName := Trim(Copy(HTML, actposStart-3, 1));
logMessage('before Name :'+ beforeName);

If copy(NameTemp,1,9) = 'alias for' then NameTemp := '';

Case NameTemp of
  '' :      Begin                     //Name in alias for ....
            actPosEnd := PosFrom('href="', HTML, actPosEnd);
            end;
           
  nomAct :  Begin                     //Same name as Title
            Case BeforeName of
              'c' : Begin             //Real Name
              RealName := NameTemp;
              AliasName := NameTemp;
              LogMessage('Real Name :' + RealName);
              // Get URL
              urlPosStart := Prevpos('href="', HTML, actposStart);
        urlPosend := PosFrom('" class="', HTML, urlPosstart);
        URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
        LogMessage('URL:' + URLTemp);
        AddMoviePerson(RealName, RealName, '', Lowercase(URLTemp), ctactors);
        AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
              end;
             
              else begin              // Good Name but Alias
              AliasName := NomAct;
              // Real Name
              actalPosStart := Posfrom('alias for ', HTML, actposEnd);
        actalposEnd := Posfrom('</span>', HTML, actalposstart);
        RealName := Trim(Copy(HTML, (actalposStart + 10), (actalposEnd - actalposStart - 10)));
        // Get URL
        urlPosStart := PrevPos('href="', HTML, actPosstart);
        urlPosend := PosFrom('" class="', HTML, urlPosstart);
        URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
        LogMessage('URL :' + URLTemp);
        AddMoviePerson(NomAct, RealName, '', Lowercase(URLTemp), ctactors);
        AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
              end;
            end;
 
            End;
    else begin
    // Alias Name
    actPosStart:= PrevPos('>', HTML, curpos);
    actPosEnd := Posfrom('</', HTML, actposStart);
    AliasName := Trim(Copy(HTML, actPosStart+1, (actPosEnd-actPosStart-1)));
    LogMessage('Alias Name :' + AliasName);
    beforeName := Trim(Copy(HTML, actposStart-3, 1));
   
      Case beforename of
        'c' : Begin                   // Alias is real Name
              // Real Name
              RealName := AliasName;
              LogMessage('Real Name :' + RealName);
              // Get URL
              urlPosStart := Prevpos('href="', HTML, actposStart);
        urlPosend := PosFrom('" class="', HTML, urlPosstart);
        URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
        LogMessage('URL:' + URLTemp);
        AddMoviePerson(NomAct, RealName, '', Lowercase(URLTemp), ctactors);
        AddSearchResult(AliasName, RealName, '', LowerCase(URLTemp),'');
              end;
        else begin
              // Real Name
              actalPosStart := Posfrom('alias for ', HTML, actposEnd);
        actalposEnd := Posfrom('</span>', HTML, actalposstart);
        RealName := Trim(Copy(HTML, (actalposStart + 10), (actalposEnd - actalposStart - 10)));
        NameTemp := 'alias for ' + Realname;
        // Get URL
        urlPosStart := PrevPos('href="', HTML, actPosstart);
        urlPosend := PosFrom('" class="', HTML, urlPosstart);
        URLTemp := BASE_URL + Trim(Copy(HTML, urlposStart + 6, (urlPosEnd-urlPosStart-6)));
        LogMessage('URL :' + URLTemp);
        AddMoviePerson(NomAct, RealName, '', Lowercase(URLTemp), ctactors);
        AddSearchResult(AliasName, NameTemp, '', LowerCase(URLTemp),'');
        end;
              end;
      end;
    end;

curpos := PosFrom(nomAct, HTML, actPosEnd);

end;

end;

end;

It seems to work!
We can now search with part of name or part of alias name (only if the part is in good alphabetic page).

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2667
    • View Profile
Re: Script for egafd.com
« Reply #93 on: December 21, 2011, 06:41:02 pm »
Quote
It seems to work!
We can now search with part of name or part of alias name (only if the part is in good alphabetic page).

That's it, now is the correct  search result.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline pra15

  • Older Power User
  • *****
  • Posts: 173
    • View Profile
Re: Script for egafd.com
« Reply #94 on: December 24, 2011, 09:29:04 pm »
Merry Christmas!

Sorry, no connection since 3 days.

I noted a problem with search procedure.
Sometimes the prlist not appears and PVD get automatically one page.

For ewample if you search Natacha, the script download info of Natacha but in the egafd (N) page there are other Natacha ( Natacha [2] , Natacha [3].....), so i would like that in the prlist i can choose the good natacha.
I you have an idea why the prlist not appears?

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2667
    • View Profile
Re: Script for egafd.com
« Reply #95 on: December 25, 2011, 07:25:29 am »
Quote
Merry Christmas!

The same back.

For ewample if you search Natacha, the script download info of Natacha but in the egafd (N) page there are other Natacha ( Natacha [2] , Natacha [3].....), so i would like that in the prlist i can choose the good natacha.
I you have an idea why the prlist not appears?

With me everything is OK with the results.
Picture attached.
egafd_people (4) (Ivek23)13 script attached.

[attachment deleted by admin]
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2667
    • View Profile
Re: Script for egafd.com
« Reply #96 on: December 25, 2011, 02:57:03 pm »
egafd_people (pra15)13 script attached.

[attachment deleted by admin]
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline pra15

  • Older Power User
  • *****
  • Posts: 173
    • View Profile
Re: Script for egafd.com
« Reply #97 on: December 25, 2011, 03:17:49 pm »
For me not work.
The script download directly data from http://www.egafd.com/actresses/details.php/id/n00082, i have not the list
and i don't understand why.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2667
    • View Profile
Re: Script for egafd.com
« Reply #98 on: December 25, 2011, 04:30:14 pm »
For me not work.
The script download directly data from http://www.egafd.com/actresses/details.php/id/n00082, i have not the list
and i don't understand why.

I also certainly do not understand this, why not.

Tip:
If you made ​​a backup database, then do the Restore Database, then close the PVD and then restart the PVD. This should give the result, at least for me it works, if the problem when I edit the script.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline pra15

  • Older Power User
  • *****
  • Posts: 173
    • View Profile
Re: Script for egafd.com
« Reply #99 on: December 25, 2011, 05:11:13 pm »
I found the problem,
It's not in the script but is an option on PVD who's not checked!
Preferences -> Divers (Various in english i think) -> Toujours montrer la liste sélectionnée pendant l'import d'information (always show selected list during information import)

I can now seriously works to search procedure for egafd_ movie.

I added a little thing in the beginning of parse people, in the case where your name in the title is different that the real name of a person :

Code: [Select]
// Write real Name of the web page //
Curpos := Pos('<html>',HTML);
AddFieldValue(pfTransname,(TextBetween(HTML,'<title>','</title>',False,Curpos)));
« Last Edit: December 25, 2011, 05:41:10 pm by pra15 »