Programmation questions

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

It could be done, but a little annoying :
in the treeview you can display a list of image titles, linked to their address. The user could see the selected image by clicking on the "view page" button.
But there is no way to show all images directly and let the user pick one.
fulvio53s03
Posts: 744
Joined: 2007-04-28 05:46:43
Location: Italy

Folders

Post by fulvio53s03 »

In my home network I have three computers and I liked to have only 1 AMC.
To do this, every PC used the same program in a network folder placed on the server but it often happened that the program crashed ('out of memory').
As I couldn't find the reason why, I decided to have 1 AMC in every PC but.... when I update scripts or templates I need to update them on every PC.
I Would like to have 1 only folder to contain scripts and 1 only folder for templates (on the server, obviousely).

Should it be possible? It could be very useful to me.....

Thanks for your help.
:grinking:
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

In Menu>Tools>Preferences>Folders you will find a drop-down box to choose which folders you want to change. Choose "Load/Save templates" and "Load/Save scripts" and change the folder on the field below ("Use this folder"). Don't forget to hit save button then.
fulvio53s03
Posts: 744
Joined: 2007-04-28 05:46:43
Location: Italy

Post by fulvio53s03 »

bad4u wrote:In Menu>Tools>Preferences>Folders you will find a drop-down box to choose which folders you want to change. Choose "Load/Save templates" and "Load/Save scripts" and change the folder on the field below ("Use this folder"). Don't forget to hit save button then.
Too easy! :shaking:
Thanks. :grinking:


--- a little later...
Oh no.... I was too fast to give an answer!
There must be something wrong as I tried but solution given is not OK... :??:
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

I never used this feature, so I just took a guess it would work this way (at least that's what I thought it would be for, though not really for sharing network access). But what exactly does not work ?
fulvio53s03
Posts: 744
Joined: 2007-04-28 05:46:43
Location: Italy

Post by fulvio53s03 »

bad4u wrote:I never used this feature, so I just took a guess it would work this way (at least that's what I thought it would be for, though not really for sharing network access). But what exactly does not work ?
Scripts and templates are non loaded after changes, both in current session (after my OK, obviousely) and after closing/opening AMC .
Thanks.
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

that feature is for the default folder used in the "open file" dialogs. Scripts are only searched in "scripts" subfolder :/
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Ouch. Learn something new every day. Sorry for misleading information.
fulvio53s03
Posts: 744
Joined: 2007-04-28 05:46:43
Location: Italy

Post by fulvio53s03 »

antp wrote:that feature is for the default folder used in the "open file" dialogs. Scripts are only searched in "scripts" subfolder :/
No way to solute using a new option? :cry:
next release? :hihi:

Thanks anyway.
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

For local folders on NTFS drive it is still possible to change the real location of the files using junction points / hardlinks, but for a network drive I do not have an idea (as I think these hardlinks won't work on that)

It is a feature planned for the next release (as for Vista/Seven I have to change the scripts folder anyway, to place it outside Program Files). The only "problem" is ... when will I do that :D
cluis_henrique
Posts: 21
Joined: 2010-01-21 00:54:05

Google Translator in variable

Post by cluis_henrique »

I'm using more of the script for IMDB course, always have everything.
But I would like to translate the comments by google.
How to get variable fieldComments and translate its contents via google translator?
Could you post the code so I know how it looks
Raoul_Volfoni
Posts: 863
Joined: 2006-08-31 23:58:18

Post by Raoul_Volfoni »

cluis_henrique wrote:How to get variable fieldComments and translate its contents via google translator?

Answer here
bettertwo
Posts: 2
Joined: 2011-11-24 15:23:08

List all films from Site

Post by bettertwo »

[english]
Hello and thanks again for your soft.
Some pages show a structure like this: a home page and a list of subsequent pages in which only changes the number.
I created a script that lists all the movies on a page like this.
Due to the limitations of the script (or mine) I cannot add new records, so I perform the following procedure.

create a file with 5000 CRLF
import AMC (text)
run the script for all records
In first question -> save All
I use Global variables which remember values during script execution.

This script work fine, even with thousands of records and hundreds of pages.
I need a way to simplify their use.

Can I add new records at runtime?

Can you tell how many records have you selected before starting the execution?

Any additional ideas to simplify its use?

Does violates any site's rules?


Thanks in advance.

[spanish]
Hola y gracias de nuevo por tu programa.

Algunas páginas muestran una estructura como esta: una página inicial y un listado de páginas subsiguientes en las que sólo cambia el número.
He creado un script que lista todas las películas de una página de estas características.
Debido a las limitaciones del guión (o a las mías) no puedo añadir nuevos registros, por lo que realizo el siguiente procedimiento.

crear un archivo con 5000 CRLF
importo en AMC (texto)
ejecuto el guión para todas los registros
En la primera pregunta -> guardar todos
Utilizo variables globales que recuerdan su valor durante el tiempo de ejecución del programa

El script funciona muy bien, incluso trabajando con miles de registros y cientos de páginas.
Necesito alguna forma de simplificar su uso.

¿Se pueden añadir nuevos registros en tiempo de ejecución?

¿Se puede saber cuántos registros se han seleccionado antes de iniciar la ejecución?

¿Alguna idea adicional para simplificar su uso?

¿Se infringe alguna norma del site?

Gracias de antemano


Ant Movie Catalog script SeaPorn (ListAll) v1.00
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I do not know if adding new records is already possible or just planned in a future version, but knowing the number of movies and which one is the current one is possible since version 4.1 (or will be added in the next update of that version if not yet in the current beta)

About site rules, you mean the site from which you take the info?
soulsnake
Posts: 756
Joined: 2011-03-14 15:42:20
Location: France

Post by soulsnake »

I do not know if adding new records is already possible or just planned
It is planned.
I will add function: AddNewMovieToQueue: Integer
Edit: It will be added in next update.
The new movie will be added to the end of the queue.
The function will return a unique movie number.
knowing the number of movies and which one is the current one is possible since version 4.1 (or will be added in the next update of that version if not yet in the current beta)
It is already added in the current release.
Add GetIteration and GetIterationCount functions for scripts. [23/11/11 - 1:00 pm]
Soulsnake.
Last edited by soulsnake on 2011-12-01 00:33:10, edited 1 time in total.
bettertwo
Posts: 2
Joined: 2011-11-24 15:23:08

Post by bettertwo »

thanks soulsnake and antp
antp wrote: About site rules, you mean the site from which you take the info?
Yes. This is a really robot. I don't know too much about the web rules. For me, renew IP its the solution, but its necessary advise other people which use this script.

Is difficult to use this script for someone without a high handling of AMC or without programming knowledge. I think.

Thanks again.
Tutankhamon
Posts: 9
Joined: 2010-01-15 18:46:58

Post by Tutankhamon »

Please tell me

How to use the function GetPage3 (address: string; referer: string; cookies: string): string;
Same as GetPage2, but allows to specify cookies as a string: 'uid = 120; pwd = FHNHESW' for example.
In PHP:

Code: Select all

	$out="GET $file HTTP/1.1\r\n";
	$out.="Host: kinopoisk.ru\r\n";
	$out.="Referer: kinopoisk.ru\r\n";
	$out.="User-Agent: Mozilla/5.0 (compatible; Ant Movie Catalog)\r\n";
	$out.="Accept: */*\r\n";
	$out.="Cookie: forum_data[login]=Tutankhamon; forum_data[reg_key]=**********\r\n";
	$out.="Connection: close\r\n";
	$out.="\r\n";

	while (!$fp=@fsockopen("www.kinopoisk.ru", 80, $errno, $errstr, 30));
	
	fwrite($fp, $out);
	
	fclose($fp);
made the request:

Code: Select all

  Page.Text := GetPage3(Address, 'kinopoisk.ru', 'forum_data[login]=Tutankhamon; forum_data[reg_key]=**********');
But, do not correctly transferred cookie
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Maybe the cookie must be encoded, try using urlencode on the string passed as cookie.
I am not sure how this works ( :D ) as it was added just by a script (Animeka), which makes a basic use of it.
Tutankhamon
Posts: 9
Joined: 2010-01-15 18:46:58

Post by Tutankhamon »

Use urlencode does not help.
May have other advice?
KoolPal
Posts: 20
Joined: 2012-07-29 08:18:29

Modify IMDB script to search using IMDB ID instead of name

Post by KoolPal »

Hi,

I didn't want to start a new thread for this query.

The current IMDB script forces me to select the relevant movie almost every time since it searches by name and there are chances of movies with similar names around.

Can anyone guide me with necessary changes required to be made to IMDB script so that I can make it search on batch mode using the IMDB ID?

I shall save the relevant IMDB id in a custom field before hand, for e.g. tt0020629

Thanks a lot.
Post Reply