Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $data = file_get_contents('http://developer.android.com/reference/classes.html');
- $class = $_GET['name'];
- $keyword = $class . '.html';
- $lengthKey = strlen($keyword);
- $pos = strpos($data, $keyword);
- $substring = $keyword;
- $i = 0;
- $firstTen = substr($substring, 0, 10);
- $match = "/reference";
- while($firstTen != $match) {
- $i = $i + 1;
- $substring = substr($data, $pos-$i, $lengthKey+$i);
- $firstTen = substr($substring, 0, 10);
- }
- $finalURL = 'http://developer.android.com' . $substring;
- $final = '[' . $class . ']('.$finalURL.')';
- if( isset( $_REQUEST['callback'] ) ) {
- echo $_REQUEST['callback'] . "({src:'" . $final ."'});";
- } else {
- echo $final;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement