Git Product home page Git Product logo

sprd-design-upload's Introduction

Sprd-Design-Upload

Prompted by a Tweet it made sense to explore the Spreadshirt API a little bit more.

In particular it's a pitty that there was no simple way to upload a design with a commission and be able to redirect people to a product with such a design.

This project aims to provide the means to:

  • Upload a design to a spreadshirt shop
  • Place metadata and a commission on the design
  • Publish the design in a users shop
  • Provide an URL where a user can buy the design on a product like a t-shirt or a mug.

This project is intended for use with node, and relies on the fs API to read and stat files.

This project is published on npmjs.com.

Example usage

Example usage is documented in src/example.ts, which can be executed using npm start. It uses environment variables that can be read from .env which should be structured like the provided .env.example.

example.ts mainly performs two steps:

  1. It calls sessionFetch to create a fetch function that works similarly to node-fetch but also handles authentication as required by the API.
  2. It calls publishAndLink with a fetch function and the data necessary to upload and publish a design.

Project support

The question came up whether this project has continuous support. Currently aims are:

  • Dependencies should be updated from time to time.
  • PRs should be reacted to in a few days.
  • If something breaks an effort will be made to repair it.
    • There will be no monitoring of library stability so please feel free to alert of breakages either by creating an issue or by contacting @sicarius on Twitter.
  • No big effort will be made to actively increase the feature set.
    • If there are PRs with new features or adjustments that's fine.
    • This project is a commitment to a simple tool/package, but it is done in spare time and so may not the most exciting thing to attend to.

Project history

  • Initially we tried the outdated but public SpreadShirt API Documentation.
    • With this we had no luck because:
      • Uploading with an image pointer is no longer supported for security reasons.
      • Setting a commission in a shop context doesn't work any more.
  • Next we tried the current SpreadShirt T-Shirt Designer: Sketchomat.
  • We also had a look at the source of zufallsshirt.de as included in the site.
    • Alas a short look didn't offer a solution.
  • Therefore we looked at the partner area which does solve this problem, and REd the necessary API calls.

sprd-design-upload's People

Contributors

dependabot[bot] avatar runjak avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

sprd-design-upload's Issues

Recent builds were broken

On my development machine recent builds after the latest Dependabot changes were broken.
I do not currently have the energy or time to spare to fix this.
Hence it remains as is.

Note to remember recent thoughts

Recently two things came to my attention:

  1. It's cool to use a user-agent different from node-fetch.
  2. There seems to be a rate limit for publishing designs at around 50 per day. There is possibly a need to communicate this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.