social networks analisys - github api

Download Social networks analisys - github API

If you can't read please download the document

Upload: baturin

Post on 26-May-2015

310 views

Category:

Documents


0 download

TRANSCRIPT

  • 1. github

2.

  • git

3. github = git + 4. : issue tracking, wiki, downloads, code review 5. open-source, 6.

7. . 8. , , 9.

  • 495 000

10. 1 490 000 11. :Twitter, Facebook, Yahoo, jQuery, Ruby on Rails, CakePHP, curl, Rackspace Hosting 12. API

  • http://develop.github.com/

13. HTTP HTTPS 14. : yaml, json, xml 15. Bindings C#, Java, Javascript, Perl, PHP, Python, Ruby 16. : 60 17. 18. API

19. 20. following followers 21. watched 22. API

23. 24. 25. contributers 26. watchers 27. forks 28. API

  • Organization

29. Issues 30. Gist 31. Commit 32. Object 33. Network 34. Disclaimer

  • , , github API.

35.

36. http://gist.github.com/742252 37. require_once('php-github-api/lib/phpGitHubApi.php'); $github = new phpGitHubApi(); $repositories = array( array('jquery', 'jquery'), array('madrobby', 'scriptaculous'), array('jashkenas', 'coffee-script'), array('yui', 'yui3'), array('sstephenson', 'prototype'), array('mootools', 'mootools-core')); function add(&$array, $key, $value){if (!array_key_exists($key, $array)) { $array[$key] = 0; } $array[$key] += $value; } foreach ($repositories as $repository) { list($user, $reponame) = $repository; echo "Processing repository '$reponame' of user '$user'" . PHP_EOL; echo 'Getting watchers' . PHP_EOL; $watchers = $github->getRepoApi()->getRepoWatchers($user, $reponame); foreach ($watchers as $watcher) { add($rating, $watcher, 10); } echo 'Getting contributors' . PHP_EOL; $contributors = $github->getRepoApi()->getRepoContributors($user, $reponame); foreach ($contributors as $contributor) { add($rating, $contributor['login'], $contributor['contributions']); } } asort($rating); foreach ($rating as $person => $ratingValue) { echo implode(',', array($person, $ratingValue)) . PHP_EOL; } 38. 39.

40. watcher' 41. ~100 : 42. http://gist.github.com/742247 43. 44. watcher' -