Advertisement
lmohanarun

Using Angellist's activity feed to discover new startups

Oct 15th, 2015
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.38 KB | None | 0 0
  1. <!doctype html>
  2. <head>
  3. <title>Snapshot of Angellist activity</title>
  4. <link rel="import" href="statcounter-include.html">
  5. <!--Start of Zopim Live Chat Script-->
  6. <script type="text/javascript">
  7. window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
  8. d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
  9. _.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute("charset","utf-8");
  10. $.src="//v2.zopim.com/?3OEmwjPqSV4goKBnrct9k32AQkWeres8";z.t=+new Date;$.
  11. type="text/javascript";e.parentNode.insertBefore($,e)})(document,"script");
  12. </script>
  13. <!--End of Zopim Live Chat Script-->
  14. </head>
  15. <body>
  16. <div name="boxer" style="border:green 1.5px solid; width:100%;">
  17. <h2>Current angellist Activity Snapshot <a href="#" style="text-decoration:underline;color:blue" onclick="javascript:window.location.reload();">Refresh</a></h2>
  18. <h2>Back to Mohanarun.com hit back button</h2>
  19. <h4>What is it?</h4>
  20. <p align=justify>It is a way to peek into what is happening on Angellist. Rather than following Angellist rss feeds. It uses PHP, HTML5, CSS, Angellist API accessed through PHP, REST with OAuth2 flow authentication, Angellist provides a JSON API and it is a Web Service made available by Angellist. I am using this JSON emitted from Angellist's web service to present the same information (heres the raw JSON I am parsing: https://api.angel.co/1/feed/?access_token=a3b8e08dacec24df766724669d8e74189a4e7b44c65e0932 in a  user-friendly, human readable tabular format (what you see here). This application has been registered as a callback application in Angellist's developer site here: https://angel.co/api</p>
  21. <center>
  22. <?php
  23. $url = "https://api.angel.co/1/feed/?access_token=a3b8e08dacec24df766724669d8e74189a4e7b44c65e0932";
  24. if ( $url ) {
  25.     $json = file_get_contents( $url );
  26.     $data = json_decode($json);
  27.     //var_dump($data);
  28.  
  29.     //asort($data,);
  30.     //print_r($my_array);
  31.  
  32.     echo "<table width=\"90%\" border=1 style=\"border:green 1.5px solid;\" id=\"ITEMLINE\"><tr><th style=\"text-align:center;background-color:green;\">Event description</th><th style=\"text-align:center;background-color:green;\">Actor tagline</th><th style=\"text-align:center;background-color:green;\">Target tagline</th></tr>";
  33.  
  34.     $j=1;
  35.  
  36.     foreach ($data->feed as $result) {
  37.             echo "<tr>" . "<td>" . $result->description . "</td>";
  38.             echo "<td>" . $result->actor->tagline . "</td>";
  39. //          echo "<td>" . $result->target->tagline . "<button type=\"button\" onClick=\"document.getElementById('tableinvests').deleteRow(" . $j++ .")\"/></td>";
  40. //          echo "<td>" . $result->target->tagline . "<button type=\"button\" onClick=\"alert(document.getElementById('tableinvests').rows[" . $j . "].innerHTML); document.getElementById('tableinvests').deleteRow(" . $j++ .")\"/></td>";
  41.  
  42.             echo "<td>" . $result->target->tagline . "<button type=\"button\" onClick=\"alert(this.parentNode.parentNode.parentNode.parentNode.rows[this.parentNode.parentNode.rowIndex].cells[this.parentNode.cellIndex-1].innerHTML+','+this.parentNode.parentNode.parentNode.parentNode.rows[this.parentNode.parentNode.rowIndex].cells[this.parentNode.cellIndex-2].innerHTML);document.getElementById('ITEMLINE').deleteRow(this.parentNode.parentNode.rowIndex);\">Delete</button>If you mistakenly deleted something simply click \"Refresh\"</td>";
  43.  
  44.             echo "</tr>\n\n";
  45.     }
  46.     echo "</table></center>";
  47.  
  48.     //
  49.    
  50. }
  51. ?>
  52. </div> <!-- div "Boxer" at line 7 -->
  53. </body>
  54. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement