{"id":21767739,"url":"https://github.com/navinpeiris/lateral","last_synced_at":"2025-08-06T10:33:54.421Z","repository":{"id":33143437,"uuid":"36783207","full_name":"navinpeiris/lateral","owner":"navinpeiris","description":"Ruby gem for lateral.io recommendation service","archived":false,"fork":false,"pushed_at":"2019-06-19T05:39:30.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T16:11:34.170Z","etag":null,"topics":[],"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/navinpeiris.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2015-06-03T05:59:43.000Z","updated_at":"2019-06-19T05:39:32.000Z","dependencies_parsed_at":"2022-08-17T20:55:16.813Z","dependency_job_id":null,"html_url":"https://github.com/navinpeiris/lateral","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navinpeiris%2Flateral","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navinpeiris%2Flateral/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navinpeiris%2Flateral/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navinpeiris%2Flateral/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navinpeiris","download_url":"https://codeload.github.com/navinpeiris/lateral/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244745715,"owners_count":20503048,"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-11-26T13:29:44.296Z","updated_at":"2025-03-21T05:43:01.604Z","avatar_url":"https://github.com/navinpeiris.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lateral\n\nRuby wrapper for [lateral.io](https://lateral.io) content recommendation service. For more information on\nmethods allowed, returned codes etc, see the [api docs](https://lateral.io/docs).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'lateral'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install lateral\n\n## Usage\n\n### Get an API Key\n\nYou can get an API key from [https://lateral.io/](https://lateral.io/).\n\n### Use the service\n\n```ruby\ntext_matcher = Lateral::TextMatcher.new API_KEY\n```\n\n#### Available methods\n\nNOTE: The hash-bang methods throws an error if the request failed while the non hash-bang methods return null\n\n```ruby\n# Adding documents\ntext_matcher.add  document_id: 'document-id', text: 'document text'\ntext_matcher.add! document_id: 'document-id', text: 'document text'\n\n# Deleting a document\ntext_matcher.delete  document_id: 'document-id'\ntext_matcher.delete! document_id: 'document-id'\n\n# Delete all documents\ntext_matcher.delete_all\ntext_matcher.delete_all!\n\n# Fetch a document\ntext_matcher.fetch  document_id: 'document-id'\ntext_matcher.fetch! document_id: 'document-id'\n\n# List document ids\ntext_matcher.list\ntext_matcher.list!\n\n# Recommend by id\ntext_matcher.recommend_by_id  document_id: 'document-id', records: 20\ntext_matcher.recommend_by_id! document_id: 'document-id', records: 20\n\n# Recommend by text\ntext_matcher.recommend_by_text  text: 'some text', records: 20\ntext_matcher.recommend_by_text! text: 'some text', records: 20\n\n# Update meta tags\ntext_matcher.update_meta  document_id: 'document-id', meta: 'meta-tags'\ntext_matcher.update_meta! document_id: 'document-id', meta: 'meta-tags'\n\n# Update text\ntext_matcher.update_text  document_id: 'document-id', text: 'new document text'\ntext_matcher.update_text! document_id: 'document-id', text: 'new document text'\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, 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` to 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\n1. Fork it ( https://github.com/navinpeiris/lateral/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavinpeiris%2Flateral","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavinpeiris%2Flateral","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavinpeiris%2Flateral/lists"}