FBCDN image is not allowed in stream …..

             Smart Techie

                We had a requirement to share Facebook image hosted in Facebook CDN back to Facebook by using Facebook streaming API. For example the image which is there in Facebook cdn, if you try to share the same image to Facebook again we may land up seeing an error message “FBCDN image is not allowed in stream”.

What this indicates for us is Facebook won’t allow to share the images hosted in Facebook CDN

Finally we came with a work around to get rid of this problem, i.e to store the Facebook images locally and upload it back.

You can use this code to download the images from image urls and put the image url which this code is returning as part of stream API.

In this code i have used grizzly light weight server with REST API.

To work with this, launch the Main.java and pass the command line arguments as host name/ip address,port and path where the downloaded images need to store .

For example root@local$java Main localhost 9190 /opt/images

Keep in mind the mentioned jars should be in class path. asm-3.3.1.jar, grizzly-framework-2.2.16.jar, grizzly-http-2.2.16.jar, grizzly-http-server-2.2.16.jar, jackson-core-asl-1.8.5.jar, jackson-mapper-asl-1.8.5.jar, jersey-core-1.17.jar, jersey-grizzly2-1.17.jar, jersey-server-1.17.jar, jsr311-api-1.1.1.jar

Now the send request by using the below url <http>://<host name>:9190/image?imageUrl= will be the link to the image.

When the request has processed, you will able to see image under the path you have specified, and you will get the image url back from the server.Like <http>://<host name>:9190/images/13131414.jpg

You can use this url as part of your stream API.

The source code is available at https://github.com/2013techsmarts/Image-Downloader

Advertisements

I am Siva Prasad Rao Janapati. Working as a software developer. Has hands on experience on ATG Commerce(DAS/DPS/DCS), Mozu commerce, Broadleaf Commerce, Java, JEE, Spring, Play, JPA, Hibernate, Velocity, JMS, Jboss, Weblogic,Tomcat, Jetty, Apache, Apache Solr, Spring Batch, JQuery, NodeJS, SOAP, REST, MySQL, Oracle, Mongo DB, Memcached, HazelCast, Git, SVN, CVS, Ant, Maven, Gradle, Amazon Web services, Rackspace, Quartz, JMeter, Junit, Open NLP, Facebook Graph,Twitter4J, YouTube Gdata, Bazzarvoice,Yotpo, 4-Tell, Alatest, Shopzilla, Linkshare. I have hands on experience on open sources and commercial technologies.

Tagged with: , ,
Posted in Facebook

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

DZone

DZone MVB

Java Code Geeks
Java Code Geeks
%d bloggers like this: