Skip to main content

Posting Images to Imgur via Apache NiFi Using Custom Processor

Posting Images to Imgur via Apache NiFi Using Custom Processor

As part of a flow from a web camera, I decided that imgur would be a nice place to push images that I can reference publically in Cloudera Data Science Workbench calls for processing with Apache MXNet GluonCV YOLOv3.

I updated my custom processor since I needed a header.

I should make this allow for multiple headers and more.

For now, I'll stick with this.   This is built for Apache NiFi 1.9.0 and updated parameters.






PostImage Processor NAR Release
https://github.com/tspannhw/nifi-postimage-processor/releases/tag/1.1

Imgur

https://apidocs.imgur.com/

Sign up for the API to use this and head there limits.   This is for non-commercial purposes.

Here is an example image uploaded to imgur


Results From HTTP Post


post.header
{Transfer-Encoding=[chunked], Server=[nginx/1.13.5], Access-Control-Allow-Methods=[POST, GET, OPTIONS, PATCH, PUT, DELETE], Connection=[close], X-Ratelimit-Userlimit=[2000], X-Post-Rate-Limit-Reset=[52], X-Ratelimit-Clientreset=[86400], Date=[Fri, 15 Mar 2019 20:32:46 GMT], Access-Control-Allow-Headers=[Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization], X-Ratelimit-Userreset=[3600], X-Ratelimit-Userremaining=[1999], Strict-Transport-Security=[max-age=15724800; includeSubDomains;], Cache-Control=[no-store, no-cache, must-revalidate, post-check=0, pre-check=0], Access-Control-Allow-Credentials=[true], X-Post-Rate-Limit-Remaining=[1244], X-Ratelimit-Clientlimit=[12500], X-Post-Rate-Limit-Limit=[1250], X-Ratelimit-Clientremaining=[12499], Content-Type=[application/json]}
post.results
{"data":{"in_most_viral":false,"ad_type":0,"link":"https://i.imgur.com/NEfUOaY.jpg","description":null,"section":null,"title":null,"type":"image/jpeg","deletehash":"oRHxGI63iyEligc","datetime":1552681953,"has_sound":false,"id":"NEfUOaY","in_gallery":false,"vote":null,"views":0,"height":480,"bandwidth":0,"nsfw":null,"is_ad":false,"edited":"0","ad_url":"","tags":[],"account_id":0,"size":368339,"width":640,"account_url":null,"name":"","animated":false,"favorite":false},"success":true,"status":200}
post.status
OK
post.statuscode
200


Popular posts from this blog

Ingesting Drone Data From DJII Ryze Tello Drones Part 1 - Setup and Practice

Ingesting Drone Data From DJII Ryze Tello Drones Part 1 - Setup and Practice In Part 1, we will setup our drone, our communication environment, capture the data and do initial analysis. We will eventually grab live video stream for object detection, real-time flight control and real-time data ingest of photos, videos and sensor readings. We will have Apache NiFi react to live situations facing the drone and have it issue flight commands via UDP. In this initial section, we will control the drone with Python which can be triggered by NiFi. Apache NiFi will ingest log data that is stored as CSV files on a NiFi node connected to the drone's WiFi. This will eventually move to a dedicated embedded device running MiniFi. This is a small personal drone with less than 13 minutes of flight time per battery. This is not a commercial drone, but gives you an idea of the what you can do with drones. Drone Live Communications for Sensor Readings and Drone Control You must connect t

Advanced XML Processing with Apache NiFi 1.9.1

Advanced XML Processing with Apache NiFi 1.9.1 With the latest version of Apache NiFi, you can now directly convert XML to JSON or Apache AVRO, CSV or any other format supported by RecordWriters.   This is a great advancement.  To make it even easier, you don't even need to know the schema before hand.   There is a built-in option to Infer Schema. The results of an RSS (XML) feed converted to JSON and displayed in a slack channel. Besides just RSS feeds, we can grab regular XML data including XML data that is wrapped in a Zip file (or even in a Zipfile in an email, SFTP server or Google Docs). Get the Hourly Weather Observation for the United States Decompress That Zip  Unpack That Zip into Files One ZIP becomes many XML files of data. An example XML record from a NOAA weather station. Converted to JSON Automagically Let's Read Those Records With A Query and Convert the results to JSON Records

Migrating Apache Flume Flows to Apache NiFi: Kafka Source to HDFS / Kudu / File / Hive

Migrating Apache Flume Flows to Apache NiFi: Kafka Source to HDFS / Kudu / File / Hive Article 7 -  https://www.datainmotion.dev/2019/10/migrating-apache-flume-flows-to-apache_9.html Article 6 -  https://www.datainmotion.dev/2019/10/migrating-apache-flume-flows-to-apache_35.html Article 5 -  Article 4 -  https://www.datainmotion.dev/2019/10/migrating-apache-flume-flows-to-apache_8.html Article 3 -  https://www.datainmotion.dev/2019/10/migrating-apache-flume-flows-to-apache_7.html Article 2 -  https://www.datainmotion.dev/2019/10/migrating-apache-flume-flows-to-apache.html Article 1 -  https://www.datainmotion.dev/2019/08/migrating-apache-flume-flows-to-apache.html Source Code:   https://github.com/tspannhw/flume-to-nifi This is one possible simple, fast replacement for " Flafka ". Consume / Publish Kafka And Store to Files, HDFS, Hive 3.1, Kudu Consume Kafka Flow   Merge Records And Store As AVRO or ORC Consume Kafka, Upda