{"id":15497177,"url":"https://github.com/jwerle/fql-workbench","last_synced_at":"2025-04-30T16:46:39.745Z","repository":{"id":57241282,"uuid":"6567744","full_name":"jwerle/fql-workbench","owner":"jwerle","description":"A workbench for Facebook's FQL","archived":false,"fork":false,"pushed_at":"2012-11-15T22:34:58.000Z","size":450,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-15T06:38:40.713Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwerle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-06T19:16:42.000Z","updated_at":"2015-01-08T03:12:39.000Z","dependencies_parsed_at":"2022-09-08T00:40:46.860Z","dependency_job_id":null,"html_url":"https://github.com/jwerle/fql-workbench","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Ffql-workbench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Ffql-workbench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Ffql-workbench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwerle%2Ffql-workbench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwerle","download_url":"https://codeload.github.com/jwerle/fql-workbench/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251747771,"owners_count":21637404,"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","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":[],"created_at":"2024-10-02T08:31:27.071Z","updated_at":"2025-04-30T16:46:39.717Z","avatar_url":"https://github.com/jwerle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"FQLWorkbench\n============\n\n#### A workbench for Facebook's FQL\n\n### Step 1 - Install\n```\n$ sudo npm install fql-workbench -g\n```\n\n### Step 2 - Start the daemon\n```\n$ fql daemon\n```\n\n### Step 3 - Connect (Local/remote)\n```\n$ fql connect -h/--host [host] -p/--port [port] -i/--id [id] -s/--secret [secret] -u/--uid [uid] (optional) -U/--user (optional)\n```\n\n### Step 4 - Play\nAll output is yaml output.\n```\nfql\u003e SELECT uid, username, first_name, last_name, name, sex, is_app_user FROM user WHERE uid = :uid;\n... \n-\n  uid: 543985131\n  username: joseph.werle\n  first_name: Joseph\n  last_name: Werle\n  name: 'Joseph Werle'\n  sex: male\n  is_app_user: false\n\nQuery took 0.087 seconds to execute.\nfql\u003e\n```\n\n### Aliases\nThe following aliases are available within the query:\n```\n:id           - App ID\n:secret       - App Secret\n:accessToken  - The access token generated by the app id and secret\n:uid          - The UID supplied by the -u or --uid flag.\n:me           - If the -U or --user flag was supplied then the value of this variable is the uid supplied by the -u or --uid flag\n```\n\n### Commands\nThe following commands are available at the command line interface\n```\n:help \u003ccommand\u003e     - Displays usage on a given command\n:print \u003cstring\u003e     - Prints a string to the buffer\n:exit               - Exits the session\n:describe \u003ctable\u003e   - Shows a table definition\n```\n\n### Help\nUsing :help\n```\nfql\u003e :help\n... \n':help \u003ccommand\u003e - Displays usage on a given command'\n\nfql\u003e :help print\n... \n':print \u003cstring\u003e - Prints a string to the buffer'\n\nfql\u003e :help describe\n... \n':describe \u003ctable\u003e - Shows a table definition'\n\nfql\u003e \n```\n\n### Tab Completion \nThere is tab completion for the support query syntax. Tables, fields, permissions coming soon.\n```\nfql\u003e sele\nselect \nfql\u003e select name fr\nfrom \nfql\u003e select name from user w\nwhere \nfql\u003e select name from user where uid = :uid\n... \n-\n  name: 'Joseph Werle'\n\nQuery took 0.082 seconds to execute.\nfql\u003e \n```\n\n### Exiting\nYou can leave the session in a few ways.\n```\nfql\u003e :exit\n... \n$\n```\nor\n```\nQuery took 0.081 seconds to execute.\nfql\u003e exit\nExiting...\n```\n\n### Using commands\n\n``:print`` \n```\nfql\u003e :print :uid\n... \n'543985131'\n\nfql\u003e :print :id\n... \n'459902834061249'\n\nfql\u003e \n```\n\n``:show tables``\n```\nfql\u003e :show tables\n... Fetching tables from http://developers.facebook.com/docs/reference/fql/\n\ntables:\n  - album\n  - application\n  - apprequest\n  - checkin\n  - comment\n  - comments_info\n  - connection\n  - cookies\n  - developer\n  - domain\n  - domain_admin\n  - event\n  - event_member\n  - family\n  - friend\n  - friend_request\n  - friendlist\n  - friendlist_member\n  - group\n  - group_member\n  - insights\n  - like\n  - link\n  - link_stat\n  - location_post\n  - mailbox_folder\n  - message\n  - note\n  - notification\n  - object_url\n  - offer\n  - page\n  - page_admin\n  - page_blocked_user\n  - page_fan\n  - page_global_brand_child\n  - page_milestone\n  - permissions\n  - permissions_info\n  - photo\n  - photo_src\n  - photo_tag\n  - place\n  - privacy\n  - privacy_setting\n  - profile\n  - profile_pic\n  - profile_view\n  - question\n  - question_option\n  - question_option_votes\n  - review\n  - standard_friend_info\n  - standard_user_info\n  - status\n  - stream\n  - stream_filter\n  - stream_tag\n  - subscription\n  - thread\n  - translation\n  - unified_message\n  - unified_thread\n  - unified_thread_action\n  - unified_thread_count\n  - url_like\n  - user\n  - video\n  - video_tag\n```\n\n``:describe`` or ``:desc``\n```\nfql\u003e :describe insights\n... \nname: insights\nfields:\n  object_id: { name: object_id, type: { type: int }, indexable: true, description: 'The object for which you are retrieving metrics.' }\n  metric: { name: metric, type: { type: string }, indexable: true, description: 'The usage data to retrieve.' }\n  end_time: { name: end_time, type: { type: int }, indexable: true, description: \"The end of the period during which the metrics were collected,\\nexpressed as a unix time (which should always be midnight, Pacific Daylight Time)\\nor using the function end_time_date() which takes a date string in 'YYYY-MM-DD' format.\\nNote: If the unix time provided is not midnight, Pacific Daylight Time, your query may return an empty resultset.\\nExample: To obtain data for the 24-hour period starting on September 15th at 00:00 (i.e. 12:00 midnight)\\nand ending on September 16th at 00:00 (i.e. 12:00 midnight),\\nspecify 1284620400 as the end_time and 86400 as the period.\\n\\nNote: end_time should not be specified when querying lifetime metrics.\" }\n  period: { name: period, type: { type: int }, indexable: true, description: \"The length of the period during which the metrics were collected,\\nexpressed in seconds as one of 86400 (day), 604800 (week),\\n2592000 (month) or 0 (lifetime) or using the function period(),\\nwhich takes one of the strings day, week, month or lifetime.\\n\\nNote: Each metric may not have all periods available.\" }\n  value: { name: value, type: { type: mixed }, indexable: false, description: 'The value of the requested metric.' }\npermissions:\n  - access_token\n  - read_insights\n```\n\nFilter the output of a :describe call\n```\nfql\u003e :desc user perms\n... Fetching table definition for user http://developers.facebook.com/docs/reference/fql/user\n\nname: user\npermissions:\n  - user_likes\n  - user_education_history\n  - user_work_history\n  - user_religion_politics\n  - user_about_me\n  - user_notes\n  - user_status\n  - user_online_presence\n  - email\n  - user_birthday\n  - user_hometown\n  - user_relationships\n  - user_relationship_details\n  - user_activities\n  - user_interests\n  - user_location\n  - user_website\n```\n\nFilter user table to show fields and filter the output to only show the type\n```\nfql\u003e :desc user fields:type\n... Fetching table definition for user http://developers.facebook.com/docs/reference/fql/user\n\nname: user\nfields:\n  uid: int\n  username: string\n  first_name: string\n  middle_name: string\n  last_name: string\n  name: string\n  pic_small: string\n  pic_big: string\n  pic_square: string\n  pic: string\n  affiliations: array\n  profile_update_time: time\n  timezone: int\n  religion: string\n  birthday: string\n  birthday_date: string\n  devices: array\n  sex: string\n  hometown_location: array\n  meeting_sex: array\n  meeting_for: array\n  relationship_status: string\n  significant_other_id: uid\n  political: string\n  current_location: array\n  activities: string\n  interests: string\n  is_app_user: bool\n  music: string\n  tv: string\n  movies: string\n  books: string\n  quotes: string\n  about_me: string\n  hs_info: array\n  education_history: array\n  work_history: array\n  notes_count: int\n  wall_count: int\n  status: string\n  has_added_app: bool\n  online_presence: string\n  locale: string\n  proxied_email: string\n  profile_url: string\n  email_hashes: array\n  pic_small_with_logo: string\n  pic_big_with_logo: string\n  pic_square_with_logo: string\n  pic_with_logo: string\n  pic_cover: array\n  allowed_restrictions: string\n  verified: bool\n  profile_blurb: string\n  family: array\n  website: string\n  is_blocked: bool\n  contact_email: string\n  email: string\n  third_party_id: string\n  name_format: string\n  video_upload_limits: array\n  games: string\n  work: array\n  education: array\n  sports: array\n  favorite_athletes: array\n  favorite_teams: array\n  inspirational_people: array\n  languages: array\n  likes_count: int\n  friend_count: int\n  mutual_friend_count: int\n  can_post: bool\n```\n\nDescribing a single field in a table\n```\nfql\u003e :describe insights field:metric\n... \nname: insights\nfields:\n  metric: { name: metric, type: { type: string }, indexable: true, description: 'The usage data to retrieve.' }\n```\n\nFiltering meta information on a field\n```\nfql\u003e :describe insights field:metric.description\n... \nname: insights\nfields:\n  metric: 'The usage data to retrieve.'\n\nfql\u003e :describe insights field:metric.type\n... \nname: insights\nfields:\n  metric: { type: string }\n\nfql\u003e desc user field:username.type,username.name,username.description,pic.type\n... \nname: user\nfields:\n  username: [{ type: string }, username, 'The username of the user being queried.']\n  pic: [{ type: string }]\n  \n```\n\nDescribing tables that do not exist\n```\nfql\u003e :desc like\n... Fetching table definition for like http://developers.facebook.com/docs/reference/fql/like\n\n- 'Unsupported table.'\n```\n\nGetting more output from a filter\n```\nfql\u003e :desc insights fields:type,description\n... \nname: insights\nfields:\n  object_id: { type: int, description: '''The object for which you are retrieving metrics.''' }\n  metric: { type: string, description: '''The usage data to retrieve.''' }\n  end_time: { type: int, description: '\"The end of the period during which the metrics were collected,\\nexpressed as a unix time (which should always be midnight, Pacific Daylight Time)\\nor using the function end_time_date() which takes a date string in ''YYYY-MM-DD'' format.\\nNote: If the unix time provided is not midnight, Pacific Daylight Time, your query may return an empty resultset.\\nExample: To obtain data for the 24-hour period starting on September 15th at 00:00 (i.e. 12:00 midnight)\\nand ending on September 16th at 00:00 (i.e. 12:00 midnight),\\nspecify 1284620400 as the end_time and 86400 as the period.\\n\\nNote: end_time should not be specified when querying lifetime metrics.\"' }\n  period: { type: int, description: '\"The length of the period during which the metrics were collected,\\nexpressed in seconds as one of 86400 (day), 604800 (week),\\n2592000 (month) or 0 (lifetime) or using the function period(),\\nwhich takes one of the strings day, week, month or lifetime.\\n\\nNote: Each metric may not have all periods available.\"' }\n  value: { type: mixed, description: '''The value of the requested metric.''' }\n```\n\n### Examples\n\nQuery your own data\n```\nfql\u003e SELECT name FROM user WHERE uid = :uid\n... \n-\n  name: 'Joseph Werle'\n```\n\nQuery data about a Facebook page\n```\nfql\u003e SELECT name, page_id, username, description, page_url FROM page WHERE username = 'facebook';\n... \n-\n  name: Facebook\n  page_id: 20531316728\n  username: facebook\n  description: \n  page_url: 'http://www.facebook.com/facebook'\n\nQuery took 0.103 seconds to execute.\nfql\u003e \n```\n\nSELECT *\n```\nfql\u003e select * from user where uid = :uid\n... \n-\n  uid: 543985131\n  username: joseph.werle\n  first_name: Joseph\n  middle_name: \n  last_name: Werle\n  name: 'Joseph Werle'\n  pic_small: 'http://profile.ak.fbcdn.net/hprofile-ak-ash4/273334_543985131_475654434_t.jpg'\n  pic_big: 'http://profile.ak.fbcdn.net/hprofile-ak-ash4/273334_543985131_475654434_n.jpg'\n  pic_square: 'http://profile.ak.fbcdn.net/hprofile-ak-ash4/273334_543985131_475654434_q.jpg'\n  pic: 'http://profile.ak.fbcdn.net/hprofile-ak-ash4/273334_543985131_475654434_s.jpg'\n  affiliations: []\n  profile_update_time: null\n  timezone: null\n  religion: null\n  birthday: null\n  birthday_date: null\n  devices: null\n  sex: male\n  hometown_location: null\n  meeting_sex: null\n  meeting_for: null\n  relationship_status: null\n  significant_other_id: null\n  political: null\n  current_location: null\n  activities: \n  interests: \n  is_app_user: false\n  music: \n  tv: \n  movies: \n  books: \n  quotes: null\n  about_me: null\n  hs_info: null\n  education_history: []\n  work_history: []\n  notes_count: null\n  wall_count: null\n  status: null\n  has_added_app: false\n  online_presence: null\n  locale: en_US\n  proxied_email: null\n  profile_url: null\n  email_hashes: []\n  pic_small_with_logo: 'http://external.ak.fbcdn.net/safe_image.php?d=AQBqN7ykEVtkBj8a\u0026url=http%3A%2F%2Fprofile.ak.fbcdn.net%2Fhprofile-ak-ash4%2F273334_543985131_475654434_t.jpg\u0026logo\u0026v=5'\n  pic_big_with_logo: 'http://external.ak.fbcdn.net/safe_image.php?d=AQCJdVZedb1KWG1D\u0026url=http%3A%2F%2Fprofile.ak.fbcdn.net%2Fhprofile-ak-ash4%2F273334_543985131_475654434_n.jpg\u0026logo\u0026v=5'\n  pic_square_with_logo: 'http://external.ak.fbcdn.net/safe_image.php?d=AQDy8oj7Jkur4m27\u0026url=http%3A%2F%2Fprofile.ak.fbcdn.net%2Fhprofile-ak-ash4%2F273334_543985131_475654434_q.jpg\u0026logo\u0026v=5'\n  pic_with_logo: 'http://external.ak.fbcdn.net/safe_image.php?d=AQBLIlCy5KXvtmFo\u0026url=http%3A%2F%2Fprofile.ak.fbcdn.net%2Fhprofile-ak-ash4%2F273334_543985131_475654434_s.jpg\u0026logo\u0026v=5'\n  pic_cover: null\n  allowed_restrictions: null\n  verified: null\n  profile_blurb: null\n  family: []\n  website: null\n  is_blocked: null\n  contact_email: null\n  email: null\n  third_party_id: GmFMcou46KWeiU_Kg4ByPNQODS8\n  name_format: '{first} {last}'\n  video_upload_limits: null\n  games: \n  work: []\n  education: []\n  sports: []\n  favorite_athletes: []\n  favorite_teams: []\n  inspirational_people: []\n  languages: []\n  likes_count: null\n  friend_count: null\n  mutual_friend_count: null\n  can_post: false\n```\n\nMulti Query\n```\nfql\u003e  #user SELECT uid, username, name, first_name, last_name FROM user WHERE uid = :uid; #profile SELECT uid, username, name FROM #user\n... \n-\n  name: user\n  fql_result_set: [{ uid: 543985131, username: joseph.werle, name: 'Joseph Werle', first_name: Joseph, last_name: Werle }]\n-\n  name: profile\n  fql_result_set: [{ uid: 543985131, username: joseph.werle, name: 'Joseph Werle' }]\n\nQuery took 0.08 seconds to execute.\nfql\u003e\n```\n\nQuery app metric data\n```\nfql\u003e SELECT metric, value FROM insights WHERE object_id = :id AND metric = 'application_active_users' AND end_time=end_time_date('2011-06-26') AND period=period('month')\n... \n-\n  metric: application_active_users\n  value: 434\n\nQuery took 0.144 seconds to execute.\nfql\u003e \n```\n\n```\nfql\u003e SELECT metric, value FROM insights WHERE object_id = :id AND metric = 'application_like_adds' AND end_time=end_time_date('2011-06-26') AND period=period('month')\n... \n-\n  metric: application_like_adds\n  value: 87\n\nQuery took 0.125 seconds to execute.\nfql\u003e \n```\n\nCopyright and license\n---------------------\n\nCopyright 2012\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this work except in compliance with the License.\nYou may obtain a copy of the License in the LICENSE file, or at:\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n- - -\nfql-workbench copyright 2012\njoseph.werle@gmail.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwerle%2Ffql-workbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwerle%2Ffql-workbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwerle%2Ffql-workbench/lists"}