{"id":23179096,"url":"https://github.com/francis94c/og-tags","last_synced_at":"2026-05-16T08:34:32.548Z","repository":{"id":157580410,"uuid":"192168324","full_name":"francis94c/og-tags","owner":"francis94c","description":"A Code Igniter library to easily generate Open Graph Tags and other Social Meta Tags (Twitter, Facebook, etc.) in the header section of a HTML page.","archived":false,"fork":false,"pushed_at":"2020-03-03T20:39:53.000Z","size":24,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-09T16:08:32.640Z","etag":null,"topics":["codeigniter","open-graph","open-graph-protocol","php","splint","splintci"],"latest_commit_sha":null,"homepage":"http://ogp.me/","language":"PHP","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/francis94c.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-06-16T08:35:48.000Z","updated_at":"2021-01-26T01:41:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"bf70d84e-c421-4b93-9ac0-10290e796437","html_url":"https://github.com/francis94c/og-tags","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/francis94c/og-tags","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francis94c%2Fog-tags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francis94c%2Fog-tags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francis94c%2Fog-tags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francis94c%2Fog-tags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/francis94c","download_url":"https://codeload.github.com/francis94c/og-tags/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francis94c%2Fog-tags/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269518940,"owners_count":24430721,"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-08-09T02:00:10.424Z","response_time":111,"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":["codeigniter","open-graph","open-graph-protocol","php","splint","splintci"],"created_at":"2024-12-18T07:13:48.381Z","updated_at":"2026-05-16T08:34:32.517Z","avatar_url":"https://github.com/francis94c.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/francis94c/og-tags.svg?branch=master)](https://travis-ci.org/francis94c/og-tags) ![License MIT](https://img.shields.io/github/license/francis94c/og-tags.svg) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/francis94c/og-tags/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/francis94c/og-tags/?branch=master) ![Splint Identifier](https://splint.cynobit.com/shields/iconIdentifier/A3RT16543N) ![Splint Version](https://splint.cynobit.com/shields/iconVersion/A3RT16543N) ![Latest Release](https://img.shields.io/github/release/francis94c/og-tags.svg) ![Commits](https://img.shields.io/github/last-commit/francis94c/og-tags.svg)\n\n[![Open Graph Protocol](http://ogp.me/logo.png)](http://ogp.me/)\n\n# og-tags\nA Code Igniter library to easily generate and echo Open Graph Tags and other Social Meta Tags (Twitter, Facebook, etc.) in the header section of a HTML page.\n\n### Installation ###\nDownload and Install Splint from https://splint.cynobit.com/downloads/splint and run the below from the root of your Code Igniter project.\n```bash\nsplint install francis94c/og-tags\n```\n\n### Usage ###\n\nPackage supports [Descriptor Auto-loading](https://splint.cynobit.com/wiki/developer/descriptor_autoloading)\n\n```php\n$this-\u003eload-\u003epackage(\"francis94c/og-tags\"); // Descriptor Auto-load.\n\n$this-\u003eload-\u003esplint(\"francis94c/og-tags\", \"%og\"); // Specific Loading\n```\n\n---\n\n### Helper Functions ###\n\n---\n\n#### Universal Function: `og($name, $content)` ####\n`$name`: (`string`) : Open Graph Tag Name.\n`$content`: (`string`) : Open Graph Tag Content.\n```php\necho og(\"image\", \"http://example.com/logo.png\");\n// Returns \u003cmeta property=\"og:image\" content=\"http://example.com/logo.png\"/\u003e\n```\n#### Read Values from a Config File : `og_read_config($config_file_name, [$echo=false])` ####\n`$config_file_name`: (`string`) : The name of the config file you want it to load values from. This means you must reate a seperate php file in the `application/config` folder to hold og tag information.\n`[$echo]`: (`boolean`) : Optional, Whether to output the tags straight to the browser or return them as string. Default to `false`.\n\n```php\necho og_read_config(\"my_og_tags\");\n// Depending on the contents of your config file.\n// Returns \u003cmeta property=\"og:title\" content=\"A Title\"/\u003e \\n \u003cmeta property=\"og:image\" content=\"http://example.com/logo.png\"/\u003e \\n ......\n\n// Or\nog_read_config(\"my_og_tags\", true); // to echo directly to the browser.\n```\n\nThe config file should contain something like the below.\n\n```php\n$config[\"og_title\"]            = \"A Title\";\n$config[\"og_site_name\"]        = \"IMDb\";\n$config[\"og_audio\"]            = \"http://example.com/bond/theme.mp3\";\n$config[\"og_description\"]      = \"Sean Connery found fame and fortune as the suave, sophisticated British agent, James Bond.\";\n$config[\"og_determiner\"]       = \"the\";\n$config[\"og_locale\"]           = \"en_GB\";\n$config[\"og_locale:alternate\"] = \"fr_FR\";\n$config[\"og_image\"]            = \"http://example.com/rock.jpg\";\n$config[\"og_image:width\"]      = \"300\";\n$config[\"og_image:height\"]     = \"300\";\n```\nAll key names must be prefixed with 'og_'. Only scalar data type check applies to all elements here.\n\n#### `og_image($url)` ####\n`$url`: (`string`) : Page Canonical URL.\n```php\necho og_image(\"http://example.com/logo.png\");\n// Returns \u003cmeta property=\"og:image\" content=\"http://example.com/logo.png\"/\u003e\n```\n#### `og_title($title)` ####\n`$title`: (`string`) : Page title.\n```php\necho og_title(\"A Title\");\n// Returns \u003cmeta property=\"og:title\" content=\"A Title\"/\u003e\n```\n#### `og_image_width($width)` ####\n`$width`: (`int`) : Image Width.\nWill Return `\"\"` if `int` is not supplied.\n```php\necho og_image_width(400);\n// Returns \u003cmeta property=\"og:image:width\" content=\"400\"/\u003e\n```\n#### `og_image_height($height)` ####\n`$height`: (`int`) : Image Height.\nWill Return `\"\"` if `int` is not supplied.\n```php\necho og_image_height(200);\n// Returns \u003cmeta property=\"og:image:height\" content=\"200\"/\u003e\n```\n#### `og_image_size($width, $height)` ####\n`$width`: (`int`) : Image Width.\n`$height`: (`int`) : Image Height.\nWill return only valid values (`int`) of the two parameters `$width` and `$height`.\n```php\necho og_image_size(500, 200);\n// Returns \u003cmeta property=\"og:image:width\" content=\"500\"/\u003e \\n \u003cmeta property=\"og:image:height\" content=\"200\"/\u003e\n```\n#### `og_image_secure_url($url)` ####\n`$url`: (`string`) : Image URL on SSL.\n```php\necho og_image_secure_url(\"https://example.com/logo.png\");\n// Returns \u003cmeta property=\"og:image:secure_url\" content=\"https://example.com/logo.png\"/\u003e\n```\n#### `og_parse_image($image)` ####\n`$image`: (`string`) : Local file path to a valid image.\nThis function will return only valid integer values read from a valid image file.\n```php\necho og_parse_image(\"/var/www/logo.png\");\n// Returns \u003cmeta property=\"og:image:width\" content=\"500\"/\u003e \\n \u003cmeta property=\"og:image:height\" content=\"200\"/\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancis94c%2Fog-tags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrancis94c%2Fog-tags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancis94c%2Fog-tags/lists"}