{"id":15590740,"url":"https://github.com/timrogers/lloydstsb","last_synced_at":"2025-07-20T06:33:21.613Z","repository":{"id":5240576,"uuid":"6417831","full_name":"timrogers/lloydstsb","owner":"timrogers","description":"A screenscraper for Lloyds TSB's Online Banking service.","archived":false,"fork":false,"pushed_at":"2012-10-28T12:41:18.000Z","size":124,"stargazers_count":17,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-25T01:54:00.905Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"romaonthego/REFrostedViewController","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timrogers.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-10-27T14:34:59.000Z","updated_at":"2021-01-26T08:55:25.000Z","dependencies_parsed_at":"2022-09-07T07:20:23.400Z","dependency_job_id":null,"html_url":"https://github.com/timrogers/lloydstsb","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/timrogers/lloydstsb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Flloydstsb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Flloydstsb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Flloydstsb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Flloydstsb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timrogers","download_url":"https://codeload.github.com/timrogers/lloydstsb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timrogers%2Flloydstsb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266076350,"owners_count":23872741,"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-02T23:28:20.886Z","updated_at":"2025-07-20T06:33:21.589Z","avatar_url":"https://github.com/timrogers.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Lloyds TSB screen scraper\n\nI bank with Lloyds TSB - I have my current account and credit card with them. Like most online banking services though, they're not to up-to-date on APIs and the like. After looking around online, I found that there were a couple of scripts that people had built, but I didn't have much luck with them myself. So I decided to build my own screen scraper.\n\nI know the code in this is pretty messy, and as ever, it's untested. I tried to refactor it and got to the end, but then it turned out to be broken and I couldn't be bothered to fix it. So I've left it for now.\n\n### Usage\n\nThe file `example.rb` provides a very simple example of how the code works, but here's a step by step:\n\n1. Ensure the gem is installed, and then include it in your Ruby file, or in your Gemfile where appropriate:\n\n```\n$ gem install lloydstsb\n`require 'lloydstsb'\n```\n\n2. Create a hash with three symbol keys, `:username`, `:password` and `:memorable_word`, each unsurprisingly corresponding to different authentication details used\n\n```\n@settings = {\n  username: \"123456789\",\n  password: \"a secure password\",\n  memorable_word: \"banking\"\n}\n```\n\n3. Instantiate a new instance of the `LloydsTSB::Customer` object, passing in the hash from the previous step - this is used to perform the authentication required.\n\n`customer = LloydsTSB::Customer.new(@settings)`\n\n4. Call the `accounts` method of the object you just made - it'll take a few seconds, and will return a number of `LloydsTSB::Account` objects. Play with the response as you wish.\n\n```\nputs customer.name\ncustomer.accounts\ncustomer.accounts.first.transactions\n```\n\n### Data models\n\nA __LloydsTSB::Customer__ is created with `LloydsTSB::Customer.new` with a hash of settings passed in. It has the following attributes:\n\n* __agent (Mechanize::Agent)__ - the Mechanize agent used to browse around the online banking system. This will be pointing at the \"Your accounts\" page.\n* __name (string)__ - the name of the customer\n* __accounts (array)__ - an array of LloydsTSB::Account objects representing accounts held by the customer\n\nA __LloydsTSB::Account__ instance has the following attributes:\n\n* __name (string)__ - the name of the account\n* __balance (integer)__ - the balance of the account, whether positive or negative. *(NB: The true meaning of balance is affected by whether the account is a :credit_card or a :bank_account)\n* __limit (integer)__ - the credit limit for the account - this is an overdraft limit for a current account, or the spending limit on a credit card\n* __transactions (array)__ - an array containing a number of `LloydsTSB::Transaction` object - this will be the 20(?) most recent transactions on the account\n* __details__ (hash)__ - the identifying information for the account as a hash. For a bank account, this will have keys :account_number and :sort_code, with :card_number for credit cards\n* __type (symbol)__ - the type of the account, either `:credit_card` or `:bank_account`\n\nA __LloydsTSB::Account__ has many __LloydsTSB::Transaction__ instances in its transactions property. Each transaction has the following attributes:\n\n* __date (Date)__ - the date of the transaction as shown on the statement\n* __narrative (string)__ - a description of the transaction, most likely the name of the merchant\n* __type (symbol)__ - the type of transaction, usually an acronym - a list is available on the Lloyds TSB site\n* __direction (symbol)__ - either `:credit` or `:debit`, depending on what the transaction is\n* __amount (integer)__ - The amount of the transaction, obviously...\n* __unique_reference (string)___ - a hash to identify this transaction *(fairly)* uniquely...useful if you want to see whether a transaction is new or not\n\n### Limitations\n\n* I haven't tested this with savings account, so it may well mess the script up and cause exceptions. I'll need to open a savings account to test this.\n* It will only show a limited number of transactions - it doesn't navigate through the different pages\n\n### License\n\nUse this for what you will, as long as it isn't evil. If you make any changes or cool improvements, please let me know at \u003ctim+lloydstsb@tim-rogers.co.uk\u003e.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimrogers%2Flloydstsb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimrogers%2Flloydstsb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimrogers%2Flloydstsb/lists"}