Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 66 lines (57 sloc) 2.417 kb
a52c5fd Olivier Lalonde initial commit
authored
1 <?php
2
3 $api_url = "http://api.crunchbase.com/v/1/person/";
4
5 $users = array(
6 'pg' => 'paul-graham',
7 'spolsky' => 'joel-spolsky-2',
8 'a4agarwal' => 'sachin-agarwal',
9 'techcrunch' => 'michael-arrington',
10 'epi0Bauqu' => 'gabriel-weinberg',
11 'AndrewWarner' => 'andrew-warner',
12 'swombat' => 'daniel-tenner',
13 'dhh' => 'david-heinemeier-hansson',
14 'daniel_levine' => 'daniel-levine',
15 'bkrausz' => 'brian-krausz',
16 'mceachen' => 'matthew-mceachen',
17 'rgrieselhuber' => 'ray-grieselhuber',
18 'rdamico' => 'ryan-damico',
19 'jon_dahl' => 'jon-dahl',
20 'answerly' => 'joe-fahrner',
21 'jlm382' => 'jessica-mah',
22 'brianchesky' => 'brian-chesky',
23 'billclerico' => 'bill-clerico',
24 'dhouston' => 'drew-houston',
25 'danielha' => 'daniel-ha',
26 'rantfoil' => 'garry-tan',
27 'petesmithy' => 'pete-smith',
28 'justin' => 'justin-kan',
29 'gduffy' => 'greg-duffy',
30 'spencerfry' => 'spencer-fry',
31 'thinkcomp' => 'aaron-greenspan',
32 'jack7890' => 'jack-groetzinger',
33 'davewiner' => 'dave-winer'
34 );
35
36 if (isset($users[$_GET['user_id']])) {
37 // Request to crunchbase
38 $json = file_get_contents($api_url . $users[$_GET['user_id']] . '.js');
39 $person = json_decode($json);
40
41 $tooltip = substr(strip_tags($person->overview),0,200) . "... <br /><br />";
42
43 foreach($person->relationships as $relationship) {
44 if ($relationship->is_past == "true") { $tooltip .= "Ex "; }
45 $tooltip .= $relationship->title . " @ ";
46 $tooltip .= ($relationship->is_past == "true") ? $relationship->firm->name : "<strong>" . $relationship->firm->name . "</strong>";
47 $tooltip .= "<br />";
48 }
49
50 $picture = "http://dev.syskall.com/hn/anonymous.jpg";
51
52 if (!empty($person->image->available_sizes[0][1]))
53 $picture = "http://crunchbase.com/" . $person->image->available_sizes[0][1];
54 ?>
55
56 <div style="display:inline; position:relative;">
57
58 <a href="<?php echo $person->crunchbase_url; ?>" style="text-decoration:none">
59 <img src="<?php echo $picture; ?>" style="text-decoration:none;border:none;" width="30" height="30"
60 onmouseover="this.parentNode.getElementsByTagName('span')[0].style.display='block'" onmouseout="this.parentNode.getElementsByTagName('span')[0].style.display='none';" />
61 <span style="display:none;position:absolute;top:-50px;right:-250px;padding:10px;background-color:#ff6600;filter:alpha(opacity=80);-moz-opacity: 0.8; opacity: 0.8; width:220px;color:#000;text-decoration:none;border:none"><?php echo $tooltip; ?></span>
62 </a>
63 </div>
64 <?php
65 }
66 ?>
Something went wrong with that request. Please try again.