{"id":19541782,"url":"https://github.com/nullscreen/fb-video","last_synced_at":"2025-10-15T19:29:27.189Z","repository":{"id":56847894,"uuid":"58070474","full_name":"nullscreen/fb-video","owner":"nullscreen","description":"Funky is a Ruby library to fetch data about videos posted on Facebook.","archived":false,"fork":false,"pushed_at":"2022-10-30T20:47:07.000Z","size":196,"stargazers_count":7,"open_issues_count":2,"forks_count":6,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-10-07T18:24:52.786Z","etag":null,"topics":["gem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nullscreen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-04T17:22:36.000Z","updated_at":"2023-03-18T11:19:42.000Z","dependencies_parsed_at":"2022-09-09T07:50:18.527Z","dependency_job_id":null,"html_url":"https://github.com/nullscreen/fb-video","commit_stats":null,"previous_names":["fullscreen/funky"],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/nullscreen/fb-video","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullscreen%2Ffb-video","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullscreen%2Ffb-video/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullscreen%2Ffb-video/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullscreen%2Ffb-video/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nullscreen","download_url":"https://codeload.github.com/nullscreen/fb-video/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullscreen%2Ffb-video/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007019,"owners_count":26084226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gem"],"created_at":"2024-11-11T03:11:56.163Z","updated_at":"2025-10-15T19:29:27.162Z","avatar_url":"https://github.com/nullscreen.png","language":"Ruby","readme":"[![Build Status](https://travis-ci.org/Fullscreen/funky.svg?branch=master)](https://travis-ci.org/Fullscreen/funky)\n[![Coverage Status](https://coveralls.io/repos/github/Fullscreen/funky/badge.svg?branch=master)](https://coveralls.io/github/Fullscreen/funky?branch=master)\n[![Dependency Status](https://gemnasium.com/badges/github.com/Fullscreen/funky.svg)](https://gemnasium.com/github.com/Fullscreen/funky)\n[![Code Climate](http://img.shields.io/codeclimate/github/Fullscreen/funky.svg)](https://codeclimate.com/github/Fullscreen/funky)\n[![Gem Version](https://badge.fury.io/rb/funky.svg)](https://badge.fury.io/rb/funky)\n\n# Funky\n\nFunky is a Ruby library to fetch data about videos posted on Facebook, such as their title, description, number of views, comments, shares, and likes.\n\n## How it works\n\nFunky can get *public* Facebook video data whether the Graph API requires insight permission or not. For example, even though the number of shares and views are shown publicly on the web page, the Graph API will not return those results unless the user has insight permission for that video. Using Funky, you can obtain the number of shares and views without insight permissions.\n\nUnder the hood, Funky hits Facebook's APIs on some cases, while other cases it will scrape Facebook's HTML to get the data. It's kind of... funky.\n\n## Usage\n\nThis is still a very early version, and it currently can only retrieve certain Facebook video data.\n\n### Installing and Configuring Funky\n\nFirst, add funky to your Gemfile:\n\n```ruby\ngem 'funky'\n```\nThen run `bundle install`.\n\nFunky will require an App ID and an App Secret which you can obtain after registering as a developer on [Facebook for developers](https://developers.facebook.com/).\n\nThere are two ways to configure Funky with your App ID and App Secret:\n\n1. By default, Funky will look for the environment variables called `FB_APP_ID` and `FB_APP_SECRET`. You can put those keys in your `.bash_profile` and Funky will work.\n\n    ```\n    export FB_APP_ID=\"YourAppID\"\n    export FB_APP_SECRET=\"YourAppSecret\"\n    ```\n\n2. If you're using this in Rails, you can choose to create an initializer instead and configure the App ID and App Secret like so:\n\n    ```ruby\n    Funky.configure do |config|\n      config.app_id = 'YourAppID'\n      config.app_secret = 'YourAppSecret'\n    end\n    ```\n\n## API Overview\n\nFunky consists of 2 different surface APIs - one to fetch video data\nfrom Facebook and one to fetch page data from Facebook.\n\n## Pages API\n\n### Use #where clause to get an array of pages\n\n```ruby\nids = ['1487249874853741', '526533744142224']\npages = Funky::Page.where(id: ids)\npages.first.id            # =\u003e '1487249874853741'\npages.first.name          # =\u003e 'Sony Pictures'\npages.first.username      # =\u003e 'SonyPicturesGlobal'\n```\n\n### Use #posts to get an array of posts\n\n```ruby\npage = Funky::Page.find('FullscreenInc')\nposts = page.posts\nposts.first.type          # =\u003e 'video'\n```\n\n## Videos API\n\n### Use #where clause to get an array of videos\n\n```ruby\nids = ['10154439119663508', '10153834590672139']\nvideos = Funky::Video.where(id: ids)\nvideos.first.id            # =\u003e '10154439119663508'\nvideos.first.created_time  # =\u003e #\u003cDateTime: 2015-12-17T06:29:48+00:00\u003e\nvideos.first.description   # =\u003e \"Hugh Jackman coaches Great Britain's...\"\nvideos.first.length        # =\u003e 147.05\nvideos.first.picture       # =\u003e \"https://scontent.xx.fbcdn.net/v/...\"\nvideos.first.page_name     # =\u003e \"Moviefone\"\n\n```\n\nIf a non-existing video ID is passed into the where clause, it is ignored. Other video IDs will still be retrieved.\n\n```ruby\nids = ['10154439119663508', '10153834590672139', 'doesnotexist']\nvideos = Funky::Video.where(id: ids)\nvideos.count    # =\u003e 2\nvideos.first.id # =\u003e '10154439119663508'\nvideos.last.id  # =\u003e '10153834590672139'\n```\n\n### Use #find to get a single video\n\n```ruby\nvideo = Funky::Video.find('10154439119663508')\nvideo.id            # =\u003e '10154439119663508'\nvideo.like_count    # =\u003e 1169\nvideo.comment_count # =\u003e 65\nvideo.share_count   # =\u003e 348\nvideo.view_count    # =\u003e 10121\n```\n\nIf a non-existing video ID is passed into #find, Funky::ContentNotFound will be raised.\n\n```ruby\nFunky::Video.find('doesnotexist') # =\u003e raises Funky::ContentNotFound\n```\n\n### Use #find_by_url!(url) to get a single video from a url\n\n```ruby\nvideo = Funky::Video.find_by_url!('https://www.facebook.com/video.php?v=10154439119663508')\nvideo.id            # =\u003e '10154439119663508'\nvideo.like_count    # =\u003e 1169\nvideo.comment_count # =\u003e 65\nvideo.share_count   # =\u003e 348\nvideo.view_count    # =\u003e 10121\n```\n\nIf a non-existing video url is passed into #find_by_url!, Funky::ContentNotFound will be raised.\n\n```ruby\nFunky::Video.find_by_url!('https://www.facebook.com/video.php?v=doesnotexist')\n  # =\u003e raises Funky::ContentNotFound\n```\n\nThe current URL formats are supported:\n\n- `https://www.facebook.com/{page_name}/videos/vb.{alt_page_id}/{video_id}`\n- `https://www.facebook.com/{page_name}/videos/{video_id}`\n- `https://www.facebook.com/{page_id}/videos/{video_id}`\n- `https://www.facebook.com/video.php?v={video_id}`\n\n\n### Connection error\n\nShould there be a case where Funky is unable to connect to Facebook, `Funky::ConnectionError` will be raised.\n\n```ruby\n# Given funky is unable to establish a connection to Facebook\nFunky::Video.find('10154439119663508') # =\u003e raises Funky::ConnectionError\nFunky::Video.where(id: '10154439119663508') # =\u003e raises Funky::ConnectionError\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/fullscreen/funky. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullscreen%2Ffb-video","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnullscreen%2Ffb-video","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullscreen%2Ffb-video/lists"}