{"id":25328559,"url":"https://github.com/clojusc/clj-blogger","last_synced_at":"2025-07-06T22:38:23.754Z","repository":{"id":62431438,"uuid":"122752175","full_name":"clojusc/clj-blogger","owner":"clojusc","description":"A Clojure library for the Google Blogger REST API","archived":false,"fork":false,"pushed_at":"2019-02-05T16:23:56.000Z","size":271,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-12T18:24:37.815Z","etag":null,"topics":["api","blogger","clojure","google","http","rest"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clojusc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-24T15:24:41.000Z","updated_at":"2019-02-05T16:17:56.000Z","dependencies_parsed_at":"2022-11-01T21:00:58.224Z","dependency_job_id":null,"html_url":"https://github.com/clojusc/clj-blogger","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/clojusc/clj-blogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojusc%2Fclj-blogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojusc%2Fclj-blogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojusc%2Fclj-blogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojusc%2Fclj-blogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clojusc","download_url":"https://codeload.github.com/clojusc/clj-blogger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clojusc%2Fclj-blogger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263984988,"owners_count":23539769,"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":["api","blogger","clojure","google","http","rest"],"created_at":"2025-02-14T02:56:14.130Z","updated_at":"2025-07-06T22:38:23.734Z","avatar_url":"https://github.com/clojusc.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clj-blogger\n\n[![Build Status][travis-badge]][travis]\n[![Clojars Project][clojars-badge]][clojars]\n[![Tag][tag-badge]][tag]\n[![Clojure version][clojure-v]](project.clj)\n\n[![][logo]][logo-large]\n\n*A Clojure library for the Google Blogger REST API*\n\n## About\n\nThis is a simple REST (HTTP) client for Google's Blogger service. This library\nwas written against the following release of Blogger:\n * https://developers.google.com/blogger/docs/3.0/reference/\n\n\n## Before Use\n\nThere are a few things to be aware of before deciding to use this library:\n\n* Google Authentication\n* Configuration\n* Alpha Status\n\n### Google Authentication\n\nBecause this library utilizes protected Google resources, you will need to\n[set up OAuth2 access with Google][oauth2-setup]; note that this library only\nsupports using service accounts (thus avoiding the need to introduce a web\nbrowser into the mix).\n\nOnce created, there will be an option to download your OAuth2 credential data\nin JSON format -- do so. Save this to a file (e.g.,\n`~/.google/blog-publisher-oauth2-creds.json`); you will use it when creating a\nclient (see below). This file will look something like this:\n\n```json\n{\n  \"type\": \"service_account\",\n  \"project_id\": \"blog-id-you-created\",\n  \"private_key_id\": \"123abc...\",\n  \"private_key\": \"-----BEGIN PRIVATE KEY----- ... \",\n  \"client_email\": \"google-blog-updates@blog-id-you-created.iam.gserviceaccount.com\",\n  \"client_id\": \"12345...\",\n  \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n  \"token_uri\": \"https://accounts.google.com/o/oauth2/token\",\n  \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n  \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/google-blog-updates%40blog-id-you-created.iam.gserviceaccount.com\"\n}\n```\n\n\n### Configuration\n\nInstead of remembering to enter your Google blog ID every time you want to\npublish content, you can create a JSON configuration file that contains an\nassociative array with the key `blog-id` and associated value that is the\nblog ID of the blog with which you want to work.\n\nNote that if you will be repeatedly operating on Blogger resources with the\nsame `user-id`, `page-id`, or `post-id`, you may make those entries in the\nconfig file as well, and they will be used on all appropriate requests.\n\nYou can save this to a file like `~/.google/blog.json` and use it when\ncreating a client (see below). This file will look something like this:\n\n```json\n{\"blog-id\": \"12345\"}\n```\n\n\n### Alpha Status\n\nThis is a brand-new library. I'm using it to publish updates to several of my\nown blogs. As such, I've started with the API calls that I need the most.\nYou mileage may vary. That being said, if there's something you'd like to\nsee added, feel free to open a ticket or even submit a pull request :-)\n\n#### Supported API Calls\n\nHere are the API functions that have been implemented:\n\n* `get-blog`\n* `get-pageviews`\n* `get-posts`\n\n\n#### Supported Utility functions\n\nProcessing previously exported Blogger data with\n`clojusc.blogger.xml.parser.export`:\n\n* `print-entry-ids` - display the ids for all exported data with the `\u003centry\u003e` XML tag (posts, comments, layout, the blog itself, etc.)\n* `print-post-ids` - display just the ids for the `\u003centry\u003e` elements whose ids match the Blogger post id format\n* `get-post-ids` - same as above, but returns a lazy sequence of post ids instead of printing them\n* `get-entry` - given 1) XML data that has been processed by `clojure.zip/xml-zip` and 2) a Blogger `\u003centry\u003e` id, get the entry and all it's child XML nodes; returns a parsed collection that may be used by any of the `extract-*` utility functions\n* `get-posts` - given XML data that has been processed by `clojure.zip/xml-zip`, returns a lazy sequence of parsed XML entries of blog posts\n* `extract-xml-text`, `extract-attrs`, `extract-draft-bool`, `extract-author`, `extract-tags`, `extract-url`, `extract-post` - given a parsed collection (e.g., as returned by `get-entry`) and potentially additional parameters, extract the desired data. In the cases of `extract-author` and `extract-post`, a hash-map is returned that represents the node's children; all others return just the data itself.\n* `extract-posts` - given XML data that has been processed by `clojure.zip/xml-zip`, return a lazy sequence of blog post hash-map data\n\nFor example usage, see the unit tests in the `clojusc.blogger.test.xml.parser.export`\nnamespace.\n\n\n#### Unsupported API Calls\n\nThese are the ones remaining:\n\n* `get-blogs`\n* `get-comment`\n* `get-comments`\n* `approve-comment`\n* `delete-comment`\n* `spam-comment` (rename to `hide-spam-comment`?)\n* `remove-comment-content`\n* `get-page`\n* `get-pages`\n* `add-page`\n* `delete-page`\n* `update-page`\n* `get-post`\n* `search`\n* `add-post`\n* `delete-post`\n* `update-post`\n* `publish-post`\n* `unpublish-post`\n* `get-user`\n* `get-user-blog`\n* `get-user-post`\n* `get-user-posts`\n\n\n## Layout\n\nNote that the code layout for this project does not match the Blogger REST API\nURLs. However, since none of the function names collide, a flat namespace is\nprovided for all API calls: `clojusc.blogger.api`. The implementations for the\nprotocol defined there are provided in sensible library namespaces under\n`clojusc.blogger.api.impl.*`.\n\n\n## Client\n\nThis is essentially a very thin wrapper around\n[clj-http](https://github.com/dakrone/clj-http): we don't do anything clever on\ntop of it. Anything you'd normally pass to clj-http functions will work the\nsame with clj-blogger (in most cases, this will be the third argument to the\nfunctions in this API).\n\n\n## Documentation\n\nVersioned Clojure client documentation is available here:\n\n* [API Reference][api-docs]\n* [Marginalia][margin-docs]\n\n\n## Usage\n\nFrom the above notes (and a quick look at the source code), it should be fairly\nclear how to use the API. First, create a client:\n\n```clj\n(requre '[clojusc.blogger.api.core :as api])\n\n(def c (api/create-client {:creds-file \"blog-publisher-oauth2-creds.json\"\n                           :config-file \"blog.json\"}))\n```\n\n\n```clj\n(api/get-blog c {:blog-id \"12345\"})\n```\n\nYou can also pass options to clj-http:\n\n```clj\n(api/get-blog c {:blog-id \"12345\"} {:debug true})\n```\n\n\n### Partial Responses\n\nclj-blogger supports asking the API for just a subset of the response data.\nSimply pass the `:fields` option (per the [API partial response spec][part-resp])\nFor instance, if you'd only like to see the titles of all posts:\n\n```clj\n(api/get-posts c {:fields [\"items(title)\"]})\n```\n\n\n## License\n\nCopyright © 2018-2019, Clojure-Aided Enrichment Center\n\nDistributed under the Apache License, Version 2.0.\n\n\n\u003c!-- Named page links below: /--\u003e\n\n[travis]: https://travis-ci.org/clojusc/clj-blogger\n[travis-badge]: https://travis-ci.org/clojusc/clj-blogger.png?branch=master\n[deps]: http://jarkeeper.com/clojusc/clj-blogger\n[deps-badge]: http://jarkeeper.com/clojusc/clj-blogger/status.svg\n[logo]: resources/images/Blogger-logo-small.png\n[logo-large]: resources/images/Blogger-logo.png\n[tag-badge]: https://img.shields.io/github/tag/clojusc/clj-blogger.svg\n[tag]: https://github.com/clojusc/clj-blogger/tags\n[clojure-v]: https://img.shields.io/badge/clojure-1.10.0-blue.svg\n[jdk-v]: https://img.shields.io/badge/jdk-1.8+-blue.svg\n[clojars]: https://clojars.org/clj-blogger\n[clojars-badge]: https://img.shields.io/clojars/v/clj-blogger.svg\n[api-docs]: http://clojusc.github.io/clj-blogger/current/\n[margin-docs]: http://clojusc.github.io/clj-blogger/current/marginalia.html\n[oauth2-setup]: https://developers.google.com/blogger/docs/3.0/using\n[part-resp]: https://developers.google.com/blogger/docs/3.0/performance#partial-response\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclojusc%2Fclj-blogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclojusc%2Fclj-blogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclojusc%2Fclj-blogger/lists"}