C# Possible to search Google by image and downloading the first one? - c#

Is there a way to programatically upload an image file to search in Google, and then downloading the first one (the one with best resolution)?
EDIT: The Google Search API would not work for me, as I would have much more than 100 requests per day, and I am not willing to pay, since I am not a company

Yes, there is. The Google Custom Search API allows you to submit queries (including images) and retrieve results programmatically. There are even client libraries available for multiple languages.
EDIT: After OP changed his question, basically saying that he doesn't want to use the Google API, I can only refer to this(a bit outdated) question and quote the Google Terms of Service:
1.4 Appropriate Conduct. You shall not, and shall not allow any third party to: ... (i) directly or indirectly generate queries, or
impressions of or clicks on Results, through any automated, deceptive,
fraudulent or other invalid means (including, but not limited to,
click spam, robots, macro programs, and Internet agents);
So to recap, it is possible, but it is only legal via the API I linked above.

Related

LinkedIn - Is it possible to post into my app's user's groups?

I want to be able to automatically (after getting access tokens) choose a group amongst the groups of the user and post a link and text to them.
I've tried a few C# APIs for linked in but at the time a few months back I didn't see an option to do so.
Is it possible to even do so? The word 'group' does not even exist in LinkedIn REST Share API documentation. if it's possible, any recommended LinkedIN APIs to use for C#?
"Starting on May 12, 2015, we will be limiting the open APIs to only support the following uses"
https://developer.linkedin.com/blog/posts/2015/developer-program-changes
They no longer expose group API publicly, you have to partner them first, I wish this information was more widely spread though.

search several web sites using C#

Can I use C# to auto search websites, then return the search results?
Is there a web crawler that would do the same thing if I give it a top domain (ex: I tell it find the word "funny" on stackoverflow.com, and it would tell me all the times "funny" appeared)?
These web sites allow searching via their search bar.
Do I need the web sites cooperation to automate searches?
NOTE: I only plan to be doing about one or two searches a day, so I doubt I'll be blocked, or asked to authenticate myself.
If your planning on crawling through an entire website to count words like that if you dont cache it you will get blocked, youll be requesting every page of the website essentially. Perhaps consider integrating google domain search's instead?
Here is a link to googles page detailing how to interface with c#
http://code.google.com/apis/gdata/client-cs.html
EDIT: Sorry that wasn't quite right : http://gsalib.codeplex.com/
http://answers.oreilly.com/topic/2165-how-to-search-google-and-bing-in-c/
I would look into building an RSS aggregator. RSS is standardized, so that's probably the most reliable way to collect search results from various sources.
EDIT: For sites that don't support RSS
For the sites that don't support RSS, you can look into using a screen scraper. Check out this article on The Code Project to get you started:
http://www.codeproject.com/KB/aspnet/weather.aspx
...web sites allow searching via their search bar ... Can I use C# to auto search websites, then return the search results?
Yes, if the website provides a URL where the search-term is provided as a query-string argument to a URL.
http://yourTargetDomain?searchterm=foo
But unless the website has specifically designed the search results from that URL to be structured data, the website won't "tell [you] all the times 'funny' appeared" but will send you back a search response that is suitable for a browser to display, so you would have to parse the results out of this stream of HTML.
For example:
http://philadelphia.craigslist.org/search/tls?query=ladder&srchType=A&minAsk=&maxAsk=

Using Google translation through my application

I have two text boxes and button in my application, one for the main text and the other for the translated text.
I am trying to do this task by Google translation API, the problem that I have to sign up my website, I am still developing and running my application on my laptop.
What can I do with the API key? How can I get it without having a website?
Thanks
Important: The Google Translate API has been officially deprecated as of May 26, 2011. Due to the substantial economic burden caused by extensive abuse, the number of requests you may make per day will be limited and the API will be shut off completely on December 1, 2011. For website translations, we encourage you to use the Google Translate Element.
As Google suggests perhaps it would be simpler than creating your own to use one thats already made:
Here: http://www.google.com/webelements/#!/translate
<!-- Google Translate Element -->
<div id="google_translate_element" style="display:block"></div><script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: "af"}, "google_translate_element");
};</script>
<script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
or here: http://babelfish.yahoo.com/free_trans_service
Google says:
We highly encourage you to include an API key with each request. While
a key is not required, using one allows us to identify and contact you
to correct any problems. Read more about why it's useful to have an
API key.
Seems you don't need one.

How do I integrate google search into my C# program?

I'm working on a program in Visual C#.NET and I need some help.
I need it to be able to take in some text through a text box, then somehow send that text to google, and bring back the resulting URLs (not the full results, just the URLs) and then display those in my program. How would I do that?
Use the WebClient class to send the query to Google and read the response.
Alternatively, use a .NET library that interacts with the Google search API, like this one (this was just the first Google result).
There are also REST libraries for .NET, if you go with the newer custom search.
Unfortunately the Google Web Search API is deprecated and no longer available. However the next best thing IMO is Google Custom Search Engine.

Implementing search in web application

I am implementing an eCommerce application using ASP.Net. I would like to know if custom Google search is sufficient enough or if we plan to go implement our search functionality.. how do we go about doing it?
Ideas and Suggestions and best practices are most welcome.
Regards,
Abdel Olakara
If you don't plan on using Google Search then you really have 2 options:
If you are using SQL Server you can put all of your site text into ntext or varbinary fields so that it is search-able. Then if you have files like PDFs etc you can put the files into a table as varbinary and create a Full Text Catalog to search them. For PDFs you will need to have iFilter installed, it is part of the free Adobe Reader package. There are other iFilters. Check out http://www.ifilter.org/ for more info on them.
If you are using asp.net hosted on a windows server you can use the Windows Indexing Service and put any of the data that you want into text file or any other file format. You might still need iFilters for those formats.
I would suggest option 1 if you don't go with Google. It can be a little more complex but option 2 can have the issue that everything starts to look like it is being saved in a giant heap. You can also do some combination of 1 and 2.
You might like to look at Lucene.NET http://lucene.apache.org/lucene.net/
I have spent many years implementing search engines and using an established 3rd Party tool like Lucene will save you a lot of heartache. There are many, many gotchas and edge cases with searching. These have been dealt with to a large degree in Lucene.
As I read it, Custom Google Search is about searching web pages in your site. Contrast this with searching database contents such as lists of products or reviews of items.
What are your requirements? My guess is that when I go to an eCommerce site (eg. Amazon or something such as Trip Advisor) I want to search content that is stored in databases. So I'm doubtful that this particular Google capability fits my expectations of eCommerce.

Categories