How can I change the text and image urls in a figma design using the figma API? - figma

I want to be able to dynamically change the text and images in a figma design file, preferably using a JSON to contain the text/image urls. Is this possible with figma api or the figma file?

With the API you can't. There are only GET endpoints to nodes and files
Maybe you can do it with the plugin infrastructure.

Related

Java PDF Generation iText Alternative

I am brand new to pdf generation or rendering. I am working on a application to replace iText and create kind of a RESTful endpoints using any Java related PDF APIs.
The library should be able to convert images and.., others to PDF.
Read/fill the data from PDF programmatically and also merge.
Also, if we can host it ourselves that would be the best choice.
Could you please provide some insight into this?
Not exactly a "Java related PDF API" but since you want to go REST anyway:
We use a headless Chrome in a docker container for generating PDFs. A good starting point is hc-pdf-server. We use it as an internal service using REST.
Note that this way, documents need to be designed using HTML and CSS. Also, you need to use a template engine in order to insert contents into your documents. We use Mustache. It is simple and does the job.

Stream pdf or image using tokbox api

I want to stream pdf, ppt, image file from publisher to all subscriber using tokbox api. Is it possible to do that ?
if any one know about it please share your knowledge .
Thanks
Another option is if you can get the pdf, ppt or image onto an HTML Canvas then you can stream a Canvas into an OpenTok Session.
https://github.com/opentok/opentok-web-samples/tree/master/Publish-Canvas
This is easy to do with an image, you can use the drawImage() method.
It looks like it's also possible to do with a PDF with pdf.js:
How to load Pdf file on Canvas as a image.src?
You can use screensharing:
https://tokbox.com/developer/guides/screen-sharing/js/
It allows you to share a whole screen, or just an application window.

Easiest way to draw line graphs with Google API

I have datum in a CSV file, that I would like to be graphed by the use of Google Charts. I've done some research, and concluded the best way of doing it would be:
Upload the CSV file online from the server to Quandl
Download contents of the CSV file in to a HTML template
This will all be done with a Crontab, so the graphs will be updated in intervals - ie automatically.
Q1: Is there any other known alternatives of converting contents of a CSV file to a Google Charts
Q2: Can this be done with BASH? Or is there a more appropriate/easier languages for such a project [ie Python, JS?].
This generated graph will be embedded into a website, and thus be online.
From Google Chart docs:
The most common way to use Google Charts is with simple JavaScript
that you embed in your web page. You load some Google Chart libraries,
list the data to be charted, select options to customize your chart,
and finally create a chart object with an id that you choose. Then,
later in the web page, you create a with that id to display the
Google Chart.
Then, the most common language is javascript, why are you trying something different?

Docpad design considerations

I'm coming from a php/mysql background. I'm most familiar with the Kohana PHP framework and I'm trying to learn Docpad. I have a loose understand at this point and I've built out my first website and blog. Static content makes a lot of sense to me on Docpad.
I'm working on my photography site where I want to be able to upload new images to a portfolio. The backend needs to handle an uploaded high-resolution image and create several different copies at different resolutions of the image. My biggest question is how do I keep track of the image meta data that I want to display? Do I generate a physical file for each image that has all the particulars I want to track and use those files as my searchable database, much like how blog posts are setup?
Or should I go the route of using something like MongoDB to store image data there where it can be queried and plugged into a layout?
Regarding handling POST or GET data, should I be reading up on the express.js docs? I'm not really sure where to turn for that.
Wordpress uses TimThumb to re-size it's images: How does WordPress.com resize images dynamically?
Then there is this re-sizing library for node: node package for file attachments and image resizing
If you wanted to created like 3 different image sizes and use the backbone collection in DocPad, then you'd add your different re-sized images to those three different collections/folders. For access the images you might just be able to do it via it's file name. So when you copy, re-size and rename the image, in the rename step, concat the image size at the end, like: coolPhoto-med.jpg and then you could just do hard links to get to the image like /spring-collection/med/coolPhoto-med.jpg or you could use query engine to access them.
The file model has a meta attribute: https://github.com/bevry/docpad/blob/master/src/lib/models/file.coffee#L17
I've yet to learn how to use it yet though.
I know we chatted yesterday on #docpad IRC but I just wanted to answer you here too. If you do code something that re-sizes images for DocPad, please do consider putting it up on Github to share with the community.

Google similar image search API

I'm trying to find out if there is a way to do google similar image searches via an API?
I know the image search api is depreciated but is it still useable?
https://developers.google.com/image-search/
Also... It seems that you can do image searches with the custom search api but I can't seem to work out if a similar image search is possible.
http://thenextweb.com/dd/2012/02/14/googles-custom-search-api-now-supports-image-only-results/
Any leads on advice on working this our would be appreciated.
Thanks!
If you have a URL for a hosted image (using Dropbox, imgur, etc), the answer at https://stackoverflow.com/a/15134958/116891 shows you how to find similar images. Basically,
http://images.google.com/searchbyimage?image_url=YOUR_HOSTED_URL
That is deprecated.
But I need JSON format of similar images result.
So, I try to use google cse but this is not supported searching of similar images.
It's just displayed image search results in a custom domain.
Another method that i try is URL.
http://images.google.com/searchbyimage?image_url=YOUR_HOSTED_URL
But this is not solution what i need.
It is because able to use in the browser. I need JSON.
Conclude, I decide to use Vision API of Google.
This is very simple.
https://cloud.google.com/vision/
You can try on the top.
First, access the URL.
Second, upload your image file on the "Try API".
Third, click "JSON" tab menu on the result.
You can be seen JSON about similar images.

Resources