class-cff-parse.php
37 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | die( '-1' ); |
| 4 | } |
| 5 | |
| 6 | class CFF_Parse |
| 7 | { |
| 8 | public static function get_link( $header_data ) { |
| 9 | $link = isset( $header_data->link) ? $header_data->link : "https://facebook.com"; |
| 10 | return $link; |
| 11 | } |
| 12 | |
| 13 | public static function get_cover_source( $header_data ) { |
| 14 | $url = isset( $header_data->cover->source ) ? $header_data->cover->source : ''; |
| 15 | return $url; |
| 16 | } |
| 17 | |
| 18 | public static function get_avatar( $header_data ) { |
| 19 | $avatar = isset( $header_data->picture->data->url ) ? $header_data->picture->data->url : ''; |
| 20 | return $avatar; |
| 21 | } |
| 22 | |
| 23 | public static function get_name( $header_data ) { |
| 24 | $name = isset( $header_data->name ) ? $header_data->name : ''; |
| 25 | return $name; |
| 26 | } |
| 27 | |
| 28 | public static function get_bio( $header_data ) { |
| 29 | $about = isset( $header_data->about ) ? $header_data->about : ''; |
| 30 | return $about; |
| 31 | } |
| 32 | |
| 33 | public static function get_likes( $header_data ) { |
| 34 | $likes = isset( $header_data->fan_count ) ? $header_data->fan_count : ''; |
| 35 | return $likes; |
| 36 | } |
| 37 | } |