Page 1 of 1
Update imdb url
Posted: 2004-08-16 12:39:27
by PropheX
hi
i tried to search around to find the answer but i couldnt find one
anyways, i was wondering if there was an easy way to update my imdb urls?
right now i have a few different types of imdb urls
http://imdb.com/Title?0000000/
http://imdb.com/title/tt000000/
http://us.imdb.com/Title?0000000/
is there a simple way to make them all into one format?
Posted: 2004-08-16 15:14:22
by antp
It should be easy to do using scripting.
Posted: 2004-08-17 00:34:57
by PropheX
im not sure how
is there an older post you can point me to that will show me?
or do i have to use the imdb script to reget the urls?
Posted: 2004-08-17 07:48:27
by antp
example if you want to replace the 1st and 3rd URL style by the 2nd one :
Code: Select all
program imdbURL;
var
s: string;
begin
s := GetField(fieldURL);
s := StringReplace('http://imdb.com/Title?', 'http://imdb.com/title/tt');
s := StringReplace('http://us.imdb.com/Title?', 'http://imdb.com/title/tt');
SetField(fieldURL, s);
end.
Posted: 2004-08-17 09:47:49
by PropheX
i just tried it but i keep getting an error
"Script error : IMDBURL at position 145 (comma expected)"
sorry, i have no idea what that means and i dont have any programing experience
i tried to add a comma but it didnt help any^^;
it only changed the error messege for every comma i added, 146, 147, etc etc
also, from what i can tell, after (successfully) running this script, i'd end up with 2 different types of urls, right?
http://imdb.com/title/tt000000
and
http://imdb.com/title/tt0000000
one with 6 and one with 7
is there a way to change the 6# url to a 7# url?
if its possible, i want them all to look like
http://imdb.com/title/tt0000000
Posted: 2004-08-17 10:32:22
by antp
I forgot something, yes
Code: Select all
program imdbURL;
var
s: string;
begin
s := GetField(fieldURL);
s := StringReplace(s, 'http://imdb.com/Title?0', 'http://imdb.com/title/tt');
s := StringReplace(s, 'http://us.imdb.com/Title?0', 'http://imdb.com/title/tt');
SetField(fieldURL, s);
end.
I added a "0" in the "Title?" part so it will be replaced too, to remove a zero
How many number should be used in the "tt" URL ?
Posted: 2004-08-17 10:55:40
by PropheX
woah, its working pretty good so far
almost have the urls exactly how i want them^^
i want 7 numbers after the tt just like the imdb homepage
also, one more thing
some of my urls end with a / and some don't
is there some way to delete those as well? besides manually^^;
Posted: 2004-08-17 13:17:25
by antp
Code: Select all
program imdbURL;
var
s: string;
begin
s := GetField(fieldURL);
if StrGet(s, Length(s)) = '/' then
Delete(s, Length(s), 1);
if Length(s) = Length('http://imdb.com/title/tt000000') then
Insert('0', s, 25);
SetField(fieldURL, s);
end.
Posted: 2004-08-17 21:11:41
by Guest
im getting another error
"Script error : IMDBURL at position 98 (out of range)"
Posted: 2004-08-18 15:33:16
by antp
Probably because it found a movie that had no URL...
Code: Select all
program imdbURL;
var
s: string;
begin
s := GetField(fieldURL);
if s <> '' then
begin
if StrGet(s, Length(s)) = '/' then
Delete(s, Length(s), 1);
if Length(s) = Length('http://imdb.com/title/tt000000') then
Insert('0', s, 25);
SetField(fieldURL, s);
end;
end.
Posted: 2004-08-18 21:15:29
by PropheX
ahh, okay
i have to use both scripts^^
got it to work and all my urls are just perfect now
thanks a lot^^
Posted: 2004-10-08 15:54:56
by Bad Joker
thanks also from me, works really fine