Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- set_time_limit( 0 );
- ini_set( 'user_agent', 'Safari' );
- $json = json_decode( file_get_contents( $_SERVER['HOME'] . '/Library/Application Support/1Password 4/3rd Party Integration/bookmarks-default.json' ) );
- for( $i=0,$len=count($json); $i<$len; ++$i ){
- echo '* ' . ( $i + 1 ) . '/' . $len . ': ' . $json[$i][1] . PHP_EOL;
- $domain = parse_url( $json[$i][2], PHP_URL_HOST );
- echo ' - ' . $domain . PHP_EOL;
- $response = file_get_contents( 'http://watchtower.agilebits.com/check?h=' . urlencode( $domain ) . '&port=443' );
- if( preg_match( '/<h3>Status<\/h3>\s*(<div.+?<\/div>)/s', $response, $matches ) ){
- $r_status = trim( strip_tags( $matches[1] ) );
- echo ' - Status: ' . $r_status . PHP_EOL;
- }
- if( preg_match( '/<h3>Recommended Action<\/h3>\s*(<div.+?<\/p>)/s', $response, $matches ) ){
- $r_first_recommendation = trim( strip_tags( $matches[1] ) );
- echo ' - Recommendation: ' . $r_first_recommendation . PHP_EOL;
- }
- if( preg_match( '/<h3>Special Notes<\/h3>\s*(<div.+?<\/div>)/s', $response, $matches ) ){
- $r_special_notes = trim( strip_tags( $matches[1] ) );
- echo ' - Special Notes: ' . $r_special_notes . PHP_EOL;
- }
- echo PHP_EOL;
- }
- ?>
Add Comment
Please, Sign In to add comment