Update imdb url
Update imdb url
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?
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?
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.
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
"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
I forgot something, yes
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 ?
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.
How many number should be used in the "tt" URL ?
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.
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.