Get first Google Image Web service - ios

I'm building an iOS app and I need somewhere to get images from Google image. Let's say I'm looking for "iPhone 5s", i'd like to get the first Google image result for this research.
Is that any way to achieve this ? Maybe by building the "right" URL ?

Okay, I found This useful link, how ever it is not returning the first image, but i hope it cam be fixed. see if it is useful. Go through Sending a basic query, Here they have created a request which response into JSON format from which you can get what you need.
Hope it will be helpful.

Related

How to extract media from TWTRTweet iOS

I'm working on an iOS Twitter app. Is anyone know how to extract media, like image, video, from TWTRTweet Class?
I used break point to check the content of TWTRTweet, there's the media content, but I don' t know how to get them.
If you know, please tell me. Thank you.
I've got the same issue, I found a way to access it :
[myTWTRTweetInstance valueForKey:#"media"]
Hope it will work for you ;)

Post image base64 from iOS to twitter using request.js

I am working on iOS. In my app user can take photo and upload from Library then it will store as image base64 in database. I want to post this image into Twitter when I select from database. But I always get error message below
{"errors":[{"code":189,"message":"Error creating status."}]}'
I have found a post below really familiar my problem but I still could not make it works.
Twitter update with media with request.js
Much appreciate for your help!
Finally, I found this solution under this post:
Twitter image upload error : media parameter is missing
But one thing to note: make sure your image base64 is not contained full path. This driven me very crazy until I found it. Real example for me
var imageBase64 = data:image/jpeg;base64,4793748374837493749374937434b3b4398498343749374739479374739473947394347373479374334793748374837493749374937434b3b4398498343749374739479374739473947394347373479374334793748374837493749374937434b3b4398498343749374739479374739473947394347373479374334793748374837493749374937434b3b43984983437493747394793747394739473943473734793743...................................................................7979
It is not working. So I have to split as below:
var splitImageBase64 = imageBase64.split(",")[1];
Then it works.
I hope this may help someone else.

URL Schemes and Facebook App 5.0

There's a question already related to groups, but it seems it's much more than that. Have URL schemes been completely thrown out of the new app (aside from the generic fb://), or is there a new list of supported schemes?
In particular, we can't get to a place details page. I've also tried /pages, /page, /places, /place...
Thanks,
Ivan
I'm not sure about those urls... but I just posted what I believe is a solution for facebook business pages.. it may help? Here it is below:
OK .. seriously this took me about 90 minutes of research to figure out. It works currently under facebook ios 5.0.1 for iPhone.. haven't tried it in iPad yet.
The url is fb://profile/132753734806
NOW the important part is that number. That links to one of my clients, Charles Scott. HOWEVER, that's not their FBID or Page ID.. their Page ID is 10150348920319807
so you would think it should be fb://profile/10150348920319807 but that gives me an error.
Here's how you get the correct code.. click on any of your page's photos.. here's an example for my client https://www.facebook.com/photo.php?fbid=10150348920319807&set=a.10150348920314807.356942.132753734806&type=1&theater
if you notice the FBID that does not work follows fbid= in that URL.. the number you WANT is just before the &type=1theater but following that last period. 132753734806 is the correct code to punch in after fb://profile/
I hope that makes some sense... I know zero about code or coding but this was bothering me so much and I knew there was a way.
Now, the two questions I would love to have answered/working.. 1. if this could work on android phones 2. create a working qr code for this url so people can scan with ios devices and have it open automatically
Good luck and I hope this helps everyone!
I tried Alessandro's way but did not succeed - the number he mentioned is new every time.
I tried fb://profile?id={pageId} and it worked in my case. {pageId} is simple page id number without any tricks. Facebook app version is 5.0.1

get thumbnails of a website from their urls

I want to save the thumbnails of a website by just entering their urls , e.g if I enter http://www.google.com , it should generate the thumbnail of the google search page .
One such API that I was using till now is http://counter2.goingup.com/thumboo/image.php.
A sample url for that :
http://counter2.goingup.com/thumboo/image.php?i=1f899e4e1abf9473ccae69de4f3ec1ca|||www.google.com|||80x50
But , off late it's showing the error "URL not found" . Do anybody know what exacly has gone wrong with this API ?
Is there any other such convenient third party API out there which can be of some help to me . By convenient , I mean, it should not show a lame Screenshot queued up message everytime it fails to find any pre-existent snapshot for that website in their db.
Use PhantomJS to create screenshots. PhantomJS comes with an example called rasterize.js, which does exactly this. Example:
phantomjs rasterize.js http://raphaeljs.com/polar-clock.html clock.png
Docs here. Related projects including web services here.
http://snapit.io works well, and gives you historical caching on a CDN. For example this URL would look like
http://www.snapit.io/snaps?url=https://stackoverflow.com/questions/7907170/get-thumbnails-of-a-website-from-their-urls
if you wanted a thumbnail of 200x200 pixels (keeping aspect ratio) you could do
http://www.snapit.io/snaps?url=https://stackoverflow.com/questions/7907170/get-thumbnails-of-a-website-from-their-urls&max_width=200&max_height=200
There's a lot of other services just like this out there, most require a subscription for any substantial amount of use though (including snapit.io), http://url2png.com, http://www.shrinktheweb.com, http://www.thumbalizr.com.

Is there a URL is can use to search for an image and returns the first found image?

I want to use a URL to search for a car by its name & model and have the first image hit returned. Is there a way to achieve this? I've looked at Google & YAHOO, but they return more than I wish for.
All I need is my request to be redirected to the URL of the first found image....
One way to obtain a relevant imagine (not equal to the top hit on Google), is:
http://( Type any keyword here ).jpg.to
For example:
http://dog.jpg.to
http://biting_dog.jpg.to
http://mercedes_benz.jpg.to
I know you mentioned Yahoo didn't work, however we are utilizing a Yahoo API in a very similar context successfully. Check out the BOSS image search API. One of the reasons we originally went with BOSS was that it does not have any daily limits. The image search API also lets you filter, indicate size, and more. The results are returned in XML.
With all that being said, if we had to do it over, we would go the Bing API route, as Bing has a brighter future than Yahoo and has very similar, if not better, API. It looks like it can return results in XML, JSON, and SOAP.
EDIT:
After seeing you were JUST looking for a URL, I tried all the three major search engines and the following URL was the closest I could come to what you decribed: http://www.bing.com/images/search?q=car&view=detail&first=1
I'm afraid the only way to get exactly what you are looking for 100% client side would to be to utilize the Bing API with a jsonp result and then manipulate the DOM via Javascript. Check out this code sample for a rough start.
Bing has a pretty easy to use web search API. You can pass it a URL with various parameters and it will return an XML result. The two parameters you would be interested in would be SourceType (=Image) and ImageRequest.Count (=1).
However, you would need to parse the XML because it won't just give you back the image data.

Resources