{"id":21397320,"url":"https://github.com/silviucpp/refererparser","last_synced_at":"2025-04-16T00:59:47.185Z","repository":{"id":86640313,"uuid":"104350503","full_name":"silviucpp/refererparser","owner":"silviucpp","description":"Erlang library for extracting marketing attribution data from referrer URLs","archived":false,"fork":false,"pushed_at":"2020-04-15T22:51:06.000Z","size":27,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-16T00:59:42.812Z","etag":null,"topics":["erlang","parser","referer-url"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","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/silviucpp.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}},"created_at":"2017-09-21T13:17:40.000Z","updated_at":"2024-06-07T10:42:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4395d1b-8e09-49ad-88ae-1f48b8e9f035","html_url":"https://github.com/silviucpp/refererparser","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silviucpp%2Frefererparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silviucpp%2Frefererparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silviucpp%2Frefererparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silviucpp%2Frefererparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silviucpp","download_url":"https://codeload.github.com/silviucpp/refererparser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249178209,"owners_count":21225349,"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":["erlang","parser","referer-url"],"created_at":"2024-11-22T14:41:40.219Z","updated_at":"2025-04-16T00:59:47.148Z","avatar_url":"https://github.com/silviucpp.png","language":"Erlang","readme":"This is a Erlang library for extracting marketing attribution data from referrer URLs based on [referer-parser][1] database \n\n### Getting started:\n\n##### Integration\n\nThe application is compatible with both `rebar` or `rebar3`. Add `erluap` as a rebar dependency to your project:\n\n```\n{deps, [\n  {refererparser, \".*\", {git, \"https://github.com/silviucpp/refererparser.git\", \"master\"}},\n}.\n```\n\n##### Update database\n\nThe latest database of referers can be downloaded from [referer-parser][1] repo. This file should replace `priv/referers.json`.\nAlso it's ok to replace the `referer-tests.json` as well with the last file once you update the referers database and to rerun the tests\nin order to check that nothing broken.\n\n### API\n\nAll available mediums are inside `refererparser.hrl` as follow:\n\n```erlang\n-define(MEDIUM_UNKNOWN, unknown).\n-define(MEDIUM_INTERNAL, internal).\n-define(MEDIUM_SEARCH, search).\n-define(MEDIUM_SOCIAL, social).\n-define(MEDIUM_EMAIL, email).\n```\n\nThe referer is returned in a record defined as follow:\n\n```erlang\n\n-record(referer, {\n    medium ::medium(),\n    source = null :: ref_source(),\n    term = null :: ref_term()\n}).\n\n```\n\nIn order to get the referer you can use the `parse/2` method where you can specify The referrer URL to parse and \nthe URL of the current page.\n\n```\nrefererparser:start().\nrefererparser:parse(\n    \u003c\u003c\"http://www.google.com/search?q=gateway+cards\u0026client=safari\"\u003e\u003e, \u003c\u003c\"http://my-web.com\"\u003e\u003e).\n{ok,{referer,search,\u003c\u003c\"Google\"\u003e\u003e, \u003c\u003c\"gateway cards\"\u003e\u003e}}\n```\n\n### Tests\n\nIn order to run the tests just use `make ct` from project root after you compiled and got the deps using `rebar`\n\n[1]:https://github.com/snowplow/referer-parser\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilviucpp%2Frefererparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilviucpp%2Frefererparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilviucpp%2Frefererparser/lists"}