list of all the colleges in the US?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
matt1019
Forum Contributor
Posts: 172
Joined: Thu Jul 06, 2006 6:41 pm

list of all the colleges in the US?

Post by matt1019 »

Hmm,

Hi guys! Looking at one of the posts (list of cities,state,zip) in this section got me thinking.... is there a similar compilation of colleges/universities in the US?

thanks much! ;)

-Matt
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

matt1019
Forum Contributor
Posts: 172
Joined: Thu Jul 06, 2006 6:41 pm

Post by matt1019 »

Holy Cow!!

Just what I needed, except they do not provide in database format.... its a huge huge list to manually cut and paste too...

I can think of an idea: a source code parser.!!!

I just learned in c++ how to take a .html page, and strip everything between specified tags.

Once I finish, I will post the results here in zip format ;)

in the mean time, if someone has a "php" based solution, please share ;)

Basically, the source parser will take the page in .html form, and "take" everything between TARGET="_blank"> and </A></LI> since the name of the colleges are in between those tags.

here's an example:
<LI><A HREF="http://www.au.af.mil/" TARGET="_blank">Air University</A></LI>
<LI><A HREF="http://www.aamu.edu/" TARGET="_blank">Alabama A&M University</A></LI>
<LI><A HREF="http://www.alasu.edu/" TARGET="_blank">Alabama State University</A></LI>
<LI><A HREF="http://www.athens.edu/" TARGET="_blank">Athens State University</A></LI>
<LI><A HREF="http://www.auburn.edu/" TARGET="_blank">Auburn University</A></LI>
<LI><A HREF="http://www.aum.edu/" TARGET="_blank">Auburn University at Montgomery</A></LI>
<LI><A HREF="http://www.bsc.edu/" TARGET="_blank">Birmingham-Southern College</A></LI>
interesting little project.... worth it though ;)

-Matt
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Or how about this :P

Code: Select all

$file = file_get_contents('sourcefile.txt');

preg_match_all("#<LI>*+? TARGET=\"_blank\">(*+?)</A>#ism",$file,$matches);

foreach($matches[0] AS $match)
{
   echo $match.'<br />';
}
Not tested, of course.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
matt1019
Forum Contributor
Posts: 172
Joined: Thu Jul 06, 2006 6:41 pm

Post by matt1019 »

Hi Scotayy,

nope, does not work... gives me the following errors:
Warning: preg_match_all() [function.preg-match-all]: Compilation failed: nothing to repeat at offset 6 in getcolleges.php on line 7

Warning: Invalid argument supplied for foreach() in getcolleges.php on line 9
i tried the following also.... still no luck.

Code: Select all

<?php

error_reporting(E_ALL);

$file = file_get_contents('sourcefile.html'); 

preg_match_all("#<LI>*+? TARGET=\"_blank\">,(*+?)</A>#ism",$file,$matches,PREG_PATTERN_ORDER); 

foreach($matches[0] AS $match) 
{ 
echo $match.'<br />'; 
} 
?>
The file "sourcefile.html" does exist in the same dir as this script.

-Matt
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Ah. My bad.

Code: Select all

$file = file_get_contents('sourcefile.txt');

preg_match_all("#<LI>.+? TARGET=\"_blank\">(.+?)</A>#ism",$file,$matches); 

foreach($matches[1] AS $match) 
{ 
   echo $match.'<br />'; 
}
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
matt1019
Forum Contributor
Posts: 172
Joined: Thu Jul 06, 2006 6:41 pm

Post by matt1019 »

Hahahahahahha!! Yaarrrrrr! Genius!

I will now tweak this script so that it produces "sql" type output....so then I can just copy and paste.... and get database table filled with these values.

As again, I will post the completed sql file ;)

thanks scottayy!!


-Matt
matt1019
Forum Contributor
Posts: 172
Joined: Thu Jul 06, 2006 6:41 pm

Post by matt1019 »

No Attachments allowed?

any suggestions as to where I can upload my rar file?

(has the complete sql file ;) )

-Matt
matt1019
Forum Contributor
Posts: 172
Joined: Thu Jul 06, 2006 6:41 pm

Post by matt1019 »

Ahhh, yes.

Found a good site to host it on ;)

here's the link to the download:

http://www.upload2.net/page/download/hA ... 0.rar.html

please read the comments inside the sql file. It explains what you need to know.

-Matt
Post Reply