Skip to content

Commit

Permalink
switch to new startup_toles?v=1 endpoint and tagged people
Browse files Browse the repository at this point in the history
  • Loading branch information
niallkennedy committed Mar 26, 2013
1 parent 811c3a5 commit 4c5fa05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion api.php
Expand Up @@ -108,7 +108,7 @@ public static function get_roles_by_company( $company_id ) {
if ( ! AngelList_API::is_valid_company_id( $company_id ) )
return;

$json = AngelList_API::get_json_url( 'startup_roles?startup_id=' . $company_id );
$json = AngelList_API::get_json_url( 'startup_roles?v=1&startup_id=' . $company_id );
if ( ! empty( $json ) && isset( $json->startup_roles ) && ! empty( $json->startup_roles ) )
return $json->startup_roles;
}
Expand Down
20 changes: 10 additions & 10 deletions templates/person.php
Expand Up @@ -16,19 +16,19 @@ public function __construct( $person_data ) {
if ( isset( $person_data->role ) )
$this->role = strtolower( trim( str_replace( '_', ' ', $person_data->role ) ) );

if ( isset( $person_data->user ) ) {
if ( isset( $person_data->user->name ) )
$this->name = trim( $person_data->user->name );
if ( isset( $person_data->user->angellist_url ) ) {
$url = esc_url( $person_data->user->angellist_url, array( 'http', 'https' ) );
if ( isset( $person_data->tagged ) ) {
if ( isset( $person_data->tagged->name ) )
$this->name = trim( $person_data->tagged->name );
if ( isset( $person_data->tagged->angellist_url ) ) {
$url = esc_url( $person_data->tagged->angellist_url, array( 'http', 'https' ) );
if ( $url )
$this->url = $url;
unset( $url );
}
if ( isset( $person_data->user->image ) ) {
if ( isset( $person_data->tagged->image ) ) {
if ( ! class_exists( 'AngelList_API' ) )
require_once( dirname( dirname( __FILE__ ) ) . '/api.php' );
$url = AngelList_API::filter_static_asset_url( $person_data->user->image );
$url = AngelList_API::filter_static_asset_url( $person_data->tagged->image );
if ( $url && $url !== AngelList_API::DEFAULT_IMAGE ) {
$image = new stdClass();
$image->url = $url;
Expand Down Expand Up @@ -57,10 +57,10 @@ public static function order_by_follower_count( array $people, $limit = 3 ) {
$people_count = 0;
$people_by_followers = array();
foreach ( $people as $person ) {
if ( ! isset( $person->user ) )
if ( ! isset( $person->tagged ) )
continue;
else if ( isset( $person->user->follower_count ) && $person->user->follower_count > 0 )
$people_by_followers[ (string) $person->user->follower_count ][] = $person;
else if ( isset( $person->tagged->follower_count ) && $person->tagged->follower_count > 0 )
$people_by_followers[ (string) $person->tagged->follower_count ][] = $person;
else
$people_by_followers['0'][] = $person;
}
Expand Down

0 comments on commit 4c5fa05

Please sign in to comment.