is it possible to have http url instead of jpg in export?

If you need help on how to use the program
Post Reply
Guest

is it possible to have http url instead of jpg in export?

Post by Guest »

hello, i'm trying to build up a simple export template for my space limited web site
is there a way to have just http urls of the covers instead of the files?
seems that the option "link to original file" anyway stores jpg in hard disk
is there a workaround?
thank you so much, i DO love AMC ;)
antp
Site Admin
Posts: 9668
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

The "link to file" is a link to a local file.
In the current versiont the program cannot manager links to web pictures (it will be added in the future) but you could store the picture URL in one of the fields that you do not use, and then use this field as source for the image when exporting with something like <img src="$$ITEM_TheFieldThatHasTheLink">
Guest

Post by Guest »

that's a cool trick...but still i don't know how to include in my db the picture absolute url, i mean i search info with amc, and i would like to include picture url, gathered by scripts, mean i don't know the url, information in html
antp
Site Admin
Posts: 9668
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

In the scripts, just before the "GetPicture" call put a SetField.
e.g., in a script you find :
GetPicture(Value, ExternalPictures);
The first part is the address of the picture.
So if for example you want to store this address in the "Media Label" field, insert the following line :
SetField(fieldMedia, Value);
Guest

Post by Guest »

yeah!!!
it rocks and it rolls now
thank you man!
you REALLY have saved my web space ;)
:D
Guest

Post by Guest »

mmm, i have a slight problem...
i've found that the site has some "antileech" and replace a part of the url:
/locand/ in
/loc/500/

how can i STORE the right url?

this is the code, with your suggestion about the use of SetField,
of course thank you in advance, i'm really not able to program, not just a lazy boy :D

Code: Select all

LineNr := FindLine('<a href="posters/locp/', Page, PrevLineNr);
  if LineNr = -1 then
  begin
    LineNr := FindLine('<img src="locand/', Page, PrevLineNr);
    if LineNr > -1 then
    begin
      Line := Page.GetString(LineNr);
      Delete(Line,1,pos('<img src="locand/', Line)+9);
      SetField(fieldMedia, 'http://www.filmup.com/'+Copy(Line,1,pos('"',Line)-1));
      GetPicture('http://www.filmup.com/'+Copy(Line,1,pos('"',Line)-1), False);
    end;
  end
  else
  begin
    Line := Page.GetString(LineNr);
    Delete(Line,1,pos('<a href="posters/locp/',Line)+8);
    Line := GetLineFromOtherPage('http://www.filmup.com/'+Copy(Line,1,pos('"',Line)-1),'<img src="../loc/500/');
    if Line <> '' then
    begin

      Delete(Line,1,pos('<img src="../',Line)+12);
      SetField(fieldMedia, 'http://www.filmup.com/'+Copy(Line,1,pos('"',Line)-1) );
      GetPicture('http://www.filmup.com/posters/'+Copy(Line,1,pos('"',Line)-1), False);

    end;
  end;
antp
Site Admin
Posts: 9668
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

SetField(fieldMedia, 'http://www.filmup.com/'+StringReplace(Copy(Line,1,pos('"',Line)-1), '/locand/', '/loc/500/');
Guest

Post by Guest »

mmm...
it's a cuple of day that i try to have some results but still no changes..
even replacing the SetField() with
SetField(fieldMedia, 'http://www.filmup.com/'+StringReplace(Copy(Line,1,pos('"',Line)-1), '/locand/', '/loc/500/')); seems to change nothing on the result..
same loc/500/ instead of locand/..
any clues of what could i try
(apart from stop bothering, of course ;) )
thank you in advance
antp
Site Admin
Posts: 9668
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

maybe because there is no "/" in the front of the string.
Try remove it from the 2nd and 3rd string in the StringReplace (i.e. 'locand/' instead of '/locand/' and same for other)
Guest

Post by Guest »

not so slick, but now it works like a charme:

Code: Select all

//Picture
  LineNr := FindLine('<a href="posters/locp/', Page, PrevLineNr);
  if LineNr = -1 then
  begin
    LineNr := FindLine('<img src="locand/', Page, PrevLineNr);
    if LineNr > -1 then
    begin
      Line := Page.GetString(LineNr);
      Delete(Line,1,pos('<img src="locand/', Line)+9);
      GetPicture('http://www.filmup.com/'+Copy(Line,1,pos('"',Line)-1), False);
      SetField(fieldMedia, 'http://www.filmup.com/'+StringReplace(Copy(Line,1,pos('"',Line)-1), 'locand/', 'loc/500/'));
    end;
  end
  else
  begin
    Line := Page.GetString(LineNr);
    Delete(Line,1,pos('<a href="posters/locp/',Line)+8);
    Line := GetLineFromOtherPage('http://www.filmup.com/'+Copy(Line,1,pos('"',Line)-1),'<img src="../loc/500/');
    if Line <> '' then
    begin
      Delete(Line,1,pos('<img src="../',Line)+12);
      GetPicture('http://www.filmup.com/posters/'+Copy(Line,1,pos('"',Line)-1), False);
      SetField(fieldMedia, 'http://www.filmup.com/'+StringReplace(Copy(Line,1,pos('"',Line)-1), 'loc/500/', 'locand/'));
    end;
  end;
  DisplayResults;
really thank you for your suggestions
Post Reply