{"id":27876906,"url":"https://github.com/ethauvin/pinboard-poster","last_synced_at":"2025-05-05T02:53:46.547Z","repository":{"id":21002305,"uuid":"91547121","full_name":"ethauvin/pinboard-poster","owner":"ethauvin","description":"A small library for posting to Pinboard","archived":false,"fork":false,"pushed_at":"2025-04-25T17:03:32.000Z","size":4624,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-25T18:24:25.409Z","etag":null,"topics":["android","bookmarks","delicious","java","kotlin","pinboard","poster"],"latest_commit_sha":null,"homepage":"https://erik.thauvin.net/blog/posts/6384/pinboard-poster-for-kotlinjava","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ethauvin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2017-05-17T07:35:04.000Z","updated_at":"2025-04-25T17:03:36.000Z","dependencies_parsed_at":"2023-02-17T02:45:53.467Z","dependency_job_id":"640d3126-7ac9-4862-a237-4a930d6ee252","html_url":"https://github.com/ethauvin/pinboard-poster","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Fpinboard-poster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Fpinboard-poster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Fpinboard-poster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethauvin%2Fpinboard-poster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethauvin","download_url":"https://codeload.github.com/ethauvin/pinboard-poster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252429953,"owners_count":21746571,"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":["android","bookmarks","delicious","java","kotlin","pinboard","poster"],"created_at":"2025-05-05T02:53:45.954Z","updated_at":"2025-05-05T02:53:46.533Z","avatar_url":"https://github.com/ethauvin.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Pinboard](https://pinboard.in) Poster for Kotlin, Java and Android\n\n[![License (3-Clause BSD)](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://opensource.org/licenses/BSD-3-Clause)\n[![Kotlin](https://img.shields.io/badge/kotlin-2.1.20-7f52ff)](https://kotlinlang.org/)\n[![bld](https://img.shields.io/badge/2.2.1-FA9052?label=bld\u0026labelColor=2392FF)](https://rife2.com/bld)\n[![Release](https://img.shields.io/github/release/ethauvin/pinboard-poster.svg)](https://github.com/ethauvin/pinboard-poster/releases/latest)\n[![Maven Central](https://img.shields.io/maven-central/v/net.thauvin.erik/pinboard-poster.svg?color=blue)](https://central.sonatype.com/artifact/net.thauvin.erik/pinboard-poster)\n[![Nexus Snapshot](https://img.shields.io/nexus/s/net.thauvin.erik/pinboard-poster?label=snapshot\u0026server=https%3A%2F%2Foss.sonatype.org%2F)](https://oss.sonatype.org/content/repositories/snapshots/net/thauvin/erik/pinboard-poster/)\n\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ethauvin_pinboard-poster\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=ethauvin_pinboard-poster)\n[![GitHub CI](https://github.com/ethauvin/pinboard-poster/actions/workflows/bld.yml/badge.svg)](https://github.com/ethauvin/pinboard-poster/actions/workflows/bld.yml)\n[![CircleCI](https://circleci.com/gh/ethauvin/pinboard-poster/tree/master.svg?style=shield)](https://circleci.com/gh/ethauvin/pinboard-poster/tree/master)\n\nA small library for posting to [Pinboard](https://pinboard.in).\n\n## Examples\n\n### Kotlin\n\n```kotlin\n\nval poster = PinboardPoster(\"user:TOKEN\")\n\nposter.addPin(\"https://example.com/foo\", \"This is a test\")\nposter.addPin(\"https://example.com\", \"This is a test\", tags = arrayOf(\"foo\", \"bar\"))\nposter.deletePin(\"https://example.com/bar\")\n\n```\n\n[View Examples](https://github.com/ethauvin/pinboard-poster/blob/master/examples)\n\n### Java\n\n```java\n\nfinal PinboardPoster poster = new PinBboardPoster(\"user:TOKEN\");\n\nposter.addPin(\"https://example.com/foo\", \"This is a test\");\nposter.addPin(new PinConfig.Builder(\"https://example.com\", \"This is a test\")\n                .tags(\"foo\", \"bar\")\n                .build());\nposter.deletePin(\"https://example.com/bar\");\n```\n\n[View Examples](https://github.com/ethauvin/pinboard-poster/blob/master/examples)\n\nYour API authentication token is available on the [Pinboard settings page](https://pinboard.in/settings/password).\n\n## bld\n\nTo use with [bld](https://rife2.com/bld), include the following dependency in your [build](https://github.com/ethauvin/pinboard-poster/blob/master/examples/bld/src/bld/java/net/thauvin/erik/pinboard/samples/ExampleBuild.java) file:\n\n```java\nrepositories = List.of(MAVEN_CENTRAL, SONATYPE_SNAPSHOTS_LEGACY);\n\nscope(compile)\n    .include(dependency(\"net.thauvin.erik:pinboard-poster:1.2.0\"));\n```\nBe sure to use the [bld Kotlin extension](https://github.com/rife2/bld-kotlin) in your project.\n\n[View Example](https://github.com/ethauvin/pinboard-poster/blob/master/examples/bld/)\n\n## Gradle, Maven, etc.\n\nTo install and run from Gradle, add the following to the `build.gradle` file:\n\n```gradle\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    compile 'net.thauvin.erik:pinboard-poster:1.2.0'\n}\n```\n\n[View Examples](https://github.com/ethauvin/pinboard-poster/blob/master/examples/gradle/)  \n\nInstructions for using with Maven, Ivy, etc. can be found on [Maven Central](https://central.sonatype.com/artifact/net.thauvin.erik/pinboard-poster).\n\n## Adding\n\nThe `addPin` function support all of the [Pinboard API parameters](https://pinboard.in/api/#posts_add):\n\n```kotlin\nimport java.time.ZonedDateTime\n\nposter.addPin(\n    url = \"https://www.example.com\",\n    description = \"This is the title\",\n    extended = \"This is the extended description.\",\n    tags = arrayOf(\"tag1\", \"tag2\", \"tag3\"),\n    dt = ZonedDateTime.now(),\n    replace = true,\n    shared = true,\n    toRead = false\n)\n```\n\n`url` and `description` are required.\n\nIt returns `true` if the bookmark was added successfully, `false` otherwise.\n\n## Deleting\n\nThe `deletePin` function support all of the [Pinboard API parameters](https://pinboard.in/api/#posts_delete):\n\n```kotlin\nposter.deletePin(url = \"https://www.example.com/\")\n```\n\nIt returns `true` if the bookmark was deleted successfully, `false` otherwise.\n\n## Logging\n\nThe library used [`java.util.logging`](https://docs.oracle.com/javase/8/docs/api/java/util/logging/package-summary.html) to log errors. Logging can be configured as follows:\n\n#### Kotlin\n\n```kotlin\nwith(poster.logger) {\n    addHandler(ConsoleHandler().apply { level = Level.FINE })\n    level = Level.FINE\n    useParentHandlers = false\n}\n```\n\n#### Java\n\n```java\nfinal ConsoleHandler consoleHandler = new ConsoleHandler();\nconsoleHandler.setLevel(Level.FINE);\nfinal Logger logger = poster.getLogger();\nlogger.addHandler(consoleHandler);\nlogger.setLevel(Level.FINE);\nlogger.setUseParentHandlers(false);\n```\n\nor using a logging properties file.\n\n## API Authentication Token\n\nThe token can also be located in a [properties file](https://en.wikipedia.org/wiki/.properties) or environment variable.\n\n### Local Property\n\nFor example, using the default `PINBOARD_API_TOKEN` key value from a `local.properties` file:\n\n```ini\n# local.properties\nPINBOARD_API_TOKEN=user\\:TOKEN\n```\n\n```kotlin\nval poster = PinboardPoster(Paths.get(\"local.properties\"))\n```\n\nor by specifying your own key:\n\n```ini\n# my.properties\nmy.api.key=user\\:TOKEN\n```\n\n```kotlin\nval poster = PinboardPoster(Paths.get(\"my.properties\"), \"my.api.key\")\n```\n\nor even specifying your own property:\n\n```kotlin\nval p = Properties()\np.setProperty(\"api.key\", \"user:TOKEN\")\n\nval poster = PinboardPoster(p, \"api.key\")\n```\n\n_In all cases, the value of the `PINBOARD_API_TOKEN` environment variable is used by default if the specified property is invalid or not found._\n\n### Environment Variable\n\nIf no arguments are passed to the constructor, the value of the `PINBOARD_API_TOKEN` environment variable will be used, if any.\n\n```sh\nexport PINBOARD_API_TOKEN=\"user:TOKEN\"\n```\n\n```kotlin\nval poster = PinboardPoster()\n```\n\n## API End Point\n\nThe API end point is automatically configured to `https://api.pinboard.in/v1/`. Since Pinboard uses the `del.ico.us` API, the library could potentially be used with another compatible service. To configure the API end point, use:\n\n```kotlin\nposter.apiEndPoint = \"https://www.example.com/v1\"\n```\n\n## Contributing\n\nIf you want to contribute to this project, all you have to do is clone the GitHub\nrepository:\n\n```console\ngit clone git@github.com:ethauvin/pinboard-poster.git\n```\n\nThen use [bld](https://rife2.com/bld) to build:\n\n```console\ncd pinboard-poster\n./bld compile\n```\n\nThe project has an [IntelliJ IDEA](https://www.jetbrains.com/idea/) project structure. You can just open it after all the dependencies were downloaded and peruse the code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethauvin%2Fpinboard-poster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethauvin%2Fpinboard-poster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethauvin%2Fpinboard-poster/lists"}