troubleshooting Question

Help save me money on Custom Search Engine dev time calls

Avatar of James Hancock
James HancockFlag for United States of America asked on
JavaGoogle Chrome OSWeb Development
5 Comments2 Solutions506 ViewsLast Modified:
I am doing Google Custom Search in a Java program, and it is charging me $5 per 100 calls. This will add up during my dev window,
and I'd like to hardcode a response to help keep costs minimal.

This portion grabs the Results List... which are URL's
Result is part of the Google Custom Search API

public static void main(String[] args) throws GeneralSecurityException, IOException {
        List<Result> items = new ArrayList<Result>();
        for (long i = 1; i <= 1; i += 1) { // enter bigger numbers for bigger results
            items.addAll(executeSearch("Search Terms", i));
        StringList latestResultsLinksList = new StringList(items.size());
        StringList TitlesList = new StringList(items.size());
        for(Result r : items) {

How might I hardcode the latestResultsLinksList to equal specific URL strings in code?
Could this be in a separate class, to minimize extra blocks of code?

StringList java class is attached

Example output is below, a simple search for 'Mickey Mouse'

About 25000000 results available
0:    Mickey Mouse - Wikipedia, the free encyclopedia, ,
1:    Mickey Mouse Barack Obama Shirt - Those Shirts, ,
2:    Rand Paul hits Obama for playing 'Mickey Mouse games' – CNN ..., ,
3:    Mickey Mouse Clubhouse - Mickey's Fishy Story - YouTube, ,
4:    Obama attorney: 'Mickey Mouse' could be on ballot - WND, ,
5:    Mickey Mouse Clubhouse - Online Activites and Fun | Disney Junior, ,
6:    ACORN: Mickey Mouse for Obama? | The Economist, ,
7:    Mickey Mouse follows Obama in backing gay marriage - The Guardian, ,
8:    Chris Matthews: Obama “Big Bird” Ad is “Mickey Mouse”, ,
9:    Mickey Mouse makes an appearance - The Washington Post, ,
Join our community to see this answer!
Unlock 2 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros