{"id":24716751,"url":"https://github.com/baylorrae/gist-php-class","last_synced_at":"2025-10-09T13:31:47.987Z","repository":{"id":137876856,"uuid":"3817294","full_name":"BaylorRae/Gist-PHP-Class","owner":"BaylorRae","description":"A class that provides an easy interface for embedding and caching gists.","archived":false,"fork":false,"pushed_at":"2012-11-17T13:50:45.000Z","size":124,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T02:51:15.173Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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/BaylorRae.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-03-24T13:29:45.000Z","updated_at":"2023-08-18T11:09:41.000Z","dependencies_parsed_at":"2023-03-11T19:30:41.409Z","dependency_job_id":null,"html_url":"https://github.com/BaylorRae/Gist-PHP-Class","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BaylorRae/Gist-PHP-Class","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaylorRae%2FGist-PHP-Class","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaylorRae%2FGist-PHP-Class/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaylorRae%2FGist-PHP-Class/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaylorRae%2FGist-PHP-Class/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaylorRae","download_url":"https://codeload.github.com/BaylorRae/Gist-PHP-Class/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaylorRae%2FGist-PHP-Class/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001484,"owners_count":26083102,"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-09T02:00:07.460Z","response_time":59,"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":[],"created_at":"2025-01-27T09:14:05.621Z","updated_at":"2025-10-09T13:31:47.593Z","avatar_url":"https://github.com/BaylorRae.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is the Gist Class [![Build Status](https://secure.travis-ci.org/BaylorRae/Gist-PHP-Class.png?branch=master)](https://travis-ci.org/BaylorRae/Gist-PHP-Class)\nThe `Gist` class provides an interface for easily\n\n1. Embedding gists\n2. Caching gists\n3. Adding the gist's source to `\u003cnoscript\u003e` tags in case JS is disabled\n\n## How to Use it\n\n```php\n\u003c?php\ninclude 'gist.php';\n\n$gist = new Gist('123456', 'some_file.php');\n\necho $gist-\u003erender();\n?\u003e\n```\n\n# Available Methods\n\n## Gist::__construct\n\n\tGist::__construct($gist_id[, $file_name = null[, $cache = true]])\n\nPrepares the class for adding gists to the page\n\n### Parameters\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e$gist_id\u003c/td\u003e\n\t\t\u003ctd\u003estring\u003c/td\u003e\n\t\t\u003ctd\u003eThe ID of the gist to add\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e$file_name\u003c/td\u003e\n\t\t\u003ctd\u003estring (optional)\u003c/td\u003e\n\t\t\u003ctd\u003eWhich file to display; if empty it will embed all files\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e$cache\u003c/td\u003e\n\t\t\u003ctd\u003eboolean (optional) (default=true)\u003c/td\u003e\n\t\t\u003ctd\u003eCache the gist source in a file and display it in `\u0026lt;noscript\u0026gt;` tags\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n## Gist::script\\_tag()\n\n\tGist::script_tag()\n\nCreates the script tag for embedding gists\n\n### Return\n\n```html\n\u003cscript src=\"https://gist.github.com/123456.js\"\u003e\u003c/script\u003e\n```\n\n## Gist::noscript\\_tag()\n\n\tGist::noscript_tag()\n\nIf caching is enabled then download \nand display the gist content in\n`\u003cnoscript\u003e` tags\n\n### Return\n\n```html\n\u003cnoscript\u003e\u003cpre\u003e\u003ccode\u003eThe source gist\u003c/code\u003e\u003c/pre\u003e\u003c/noscript\u003e\n```\n\n## Gist::render()\n\nCreate the script and noscript tags\nin one go\n\n### Return\n\n```html\n\u003cscript src=\"https://gist.github.com/123456.js\"\u003e\u003c/script\u003e\n\u003cnoscript\u003e\u003cpre\u003e\u003ccode\u003eThe source gist\u003c/code\u003e\u003c/pre\u003e\u003c/noscript\u003e\n```\n\n## (private) Gist::download\\_raw\\_source()\n\nAttempt to download a gist\nand cache it into a file\n\n### Return\n{null}\n\n## (private) Gist::get\\_cache\\_name()\n\nReturns the path for where the file\nshould be cached\n\n### Return\n\n\t./gists_cache/58abasdf4858asadf58\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaylorrae%2Fgist-php-class","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaylorrae%2Fgist-php-class","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaylorrae%2Fgist-php-class/lists"}