Jump to content

looking for 2 scripts


rakuenso

Recommended Posts

... here's what im trying to do, there's a popular website called facebook, and its features for inviting members to join a group are quite bulky. I plan to make a script that automatically executes the following:

 

http://utoronto.facebook.com/groupuser.php?gid=2954&invite=1&uid=(INSERT_USER_ID_HERE)

 

where INSERT_USER_ID will be read from a list of numbers in another file.

 

I also plan to to make another script that extracts user id's from a list of search queries.

 

Any idea as to how to accomplish this?

Link to comment
Share on other sites

... here's what im trying to do' date=' there's a popular website called facebook, and its features for inviting members to join a group are quite bulky. I plan to make a script that automatically executes the following:

 

http://utoronto.facebook.com/groupuser.php?gid=2954&invite=1&uid=(INSERT_USER_ID_HERE)

 

where INSERT_USER_ID will be read from a list of numbers in another file.

 

I also plan to to make another script that extracts user id's from a list of search queries.

 

Any idea as to how to accomplish this?[/quote']

 

 

Are the numbers in a regula sequece in the file, e.g. xx,,xy,xz,xa,xb etc.?

 

If they are in that type of format or any repeating format then you could just read the file, use explode too get it seperated out then grab the part you want :)

 

Cheers,

 

Ryan Jones

Link to comment
Share on other sites

hmm yeah they are in numbers' date='

 

what script?

 

um preferabbly javascript or php[/quote']

 

PHP can do it for you with no problems :)

 

Reading the file array (Presuming that ', ' is the delimiter):

 

<?php
 $FileName = '/home/ryanjone/public_html/SomeFile.txt';
 $Dilimiter = ', ';
   # ^ This needs to be changed.
 $FileContents = explode($Dilimiter, implode('', file($FileName)));
 $Contents = $FileContents[23]; #Returns the 24th element in the array.
?>

 

Then you cnsa just extract the valuew as was done in the last line then using the Header() function you can redirect them too another page :)

 

Cheers,

 

Ryan Jones

Link to comment
Share on other sites

Ryans script takes a file and looks at is as if it were a string. The explode function then breaks that string up into an easilly manageable array using a delimeter of ', '.

 

Yup, then you can easily make a reference to any required element in the array buy using an array reference instead :)

 

Cheers,

 

Ryan Jones

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.