Posts

Showing posts with the label google

Digital Marketing

How to change Google cloud SQL timezone

Change MySQL Flag  default_time_zone to the value you want. For example, to change to Eastern Standard time: change default_time_zone to -05:00

How to change Google cloud SQL timezone

Change MySQL Flag  default_time_zone to the value you want. For example, to change to Eastern Standard time: change default_time_zone to -05:00

Blogger Feed URLs

For example, for goyun.info Full site feed: Atom 1.0: http:// goyun.info /feeds/posts/default RSS 2.0: http:// goyun.info /feeds/posts/default?alt=rss Comments-only feed: Atom 1.0: http:// goyun.info /feeds/comments/default RSS 2.0: http:// goyun.info /feeds/comments/default?alt=rss Label-specific site feed: Atom 1.0: http:// goyun.info /feeds/posts/default/-/privacy RSS 2.0: http:// goyun.info /feeds/posts/default?alt=rss/-/privacy Individual post comment feed: Note: You can find the postId of an individual post from the Posting | Edit Posts tab. Simply mouseover the 'Edit' link next to a particular post, and that postId will be displayed in your browser's status bar. Atom 1.0: http:// goyun.info /feeds/postId/comments/default RSS 2.0: http:// goyun.info /feeds/postId/comments/default?alt=rss

How to add your own custom search engine to Chrome

 Settings -> Search -> "Manage search engines..." -> "Other Search Engines" Try  https://goyun.info  as an example: Add a new search engine : search job -  this is only for use here, you won't see this anywhere else Keyword  (shortcut): goyun —  this will be used to trigger a custom search in the Omnibox; for convenience, use an abbreviation of what you'll be searching URL with %s in place of search :  https://job.goyun.info/index.jsp?keys=%s  —  for most blogs and news sites, you'll use the URL and add  search?q=%s , but other sites vary (see below) To find the URL needed to create a custom search outside of a blog or news site, it's quickest to simply Google it, e.g. "Twitter search Chrome custom search". Here's a handy list to start, collected across the web: Social Media Twitter -  http://twitter.com/search?q=%s Facebook -  https://www.facebook.com/search/more/?q=%s LinkedIn -  http://www.linkedin.com/commonSe...

Google API multiple scopes

To set multiple scopes, set the scope parameter to multiple scopes, each separated by a single space. Example: private static final List<String> SCOPES = Collections.singletonList(BloggerScopes.BLOGGER+" https://www.googleapis.com/auth/indexing");

Java HttpURLConnection example to Get Google OAuth 2.0 Access Token

There are Http Clients from Apache, many RESTFUL implementation such as Jersey. But sometimes you still may just want to use Java to access directly. Here is an example to get access_token from Google. String url = "https://accounts.google.com/o/oauth2/token" ; URL obj = new URL ( url ); HttpsURLConnection con = ( HttpsURLConnection ) obj . openConnection (); //add reuqest header con . setRequestMethod ( "POST" ); con . setRequestProperty ( "Content-Type" , "application/x-www-form-urlencoded" ); String urlParameters = "code=" + request . getParameter ( "code" ) + "&client_id=" + clientId + "&client_secret=" + CLIENT_SECRET + "&redirect_uri=" + redirectURI + "&grant_type=authorization_code" ; // for Google OAuth 2.0 // Send post request con . setDoOutput ( true ); DataOutputStream wr = new DataOutputStream ( con . getOutputStrea...

Google Safe Browsing API

Google Safe Browsing API  lets your client applications download hashed versions of the Safe Browsing lists for storage in a local database. URLs can then be checked locally. Only if a match is found in the local database does the client need to send a request to the Safe Browsing servers to verify whether the URL is included on the Safe Browsing lists.

Google App Engine PHP Runtime

It is no longer necessary to whitelist your application for deployment. Developers interested in the PHP runtime now can create an account and deploy PHP applications immediately .

Simple example to access Gmail by Java

To show the folders and their message counts: Properties props = System . getProperties (); props . setProperty ( "mail.pop3.port" , prop . getProperty ( "995" )); Session session = Session . getInstance ( props , null ); Store store = session . getStore ( "imaps" ); store . connect ( "pop.gmail.com" , "name" , "password" ); javax . mail . Folder [] dfolders = store . getDefaultFolder (). list ( "*" ); for ( Folder f : dfolders ) { System . out . println ( f . getFullName ()); if (( f . getType () & amp ; javax . mail . Folder . HOLDS_MESSAGES ) != 0 ) { System . out . println ( f . getMessageCount ()); } } On github The output: INBOX 25 [Gmail] [Gmail]/All Mail 69 [Gmail]/Drafts 0 [Gmail]/Important 1 [Gmail]/Sent Mail 6 [Gmail]/Spam 4761 [Gmail]/Starred 0 [...

Different ways of targeting AdWords ads

AdWords offers different ways of targeting: Keywords:  Words or phrases relevant to your products and service, which are used to show your ads when customers search for those terms or visit relevant websites. Ad location:  Show your ads on search engines, commercial sites, or personal sites. Age, location, and language:  Choose the age, geographic location, and language of your customers. Days, times, and frequency:  Show your ads during certain hours or days of the week, and determine how often your ads appear. Devices:  Your ads can appear on all types of devices, and you can fine-tune which devices your ads appear on and when.

How to Combine Multiple RSS Feeds with Google Scripts

This Google Script takes 2 or more RSS feeds and mashes them up into a JSON feed that you can call from an external app by publishing the script as a web app. Internally, the script uses URLFetchApp to fetch the XML feed and parses it using the Xml service. This can also be used for single widgets that output data from multiple RSS feeds.

Layers of Google Adwords

AdWords is organized into three layers: account, campaigns, ad groups. Account:  Your account is associated with a unique email address, password, and billing information. Campaigns:  Each campaign in your account has its own budget and settings that determine where your ads appear. Ad groups:  Each ad group within a campaign contains a set of similar ads and keywords that you want to trigger your ads to show.

Adwords bidding strategy

Adwords bidding strategy Choosing how you'll spend your money means choosing how you'd like to bid. Try choosing a bidding strategy based on your goals, such as whether you want to focus on getting clicks, impressions, or conversions. Here's an overview of the strategies: Cost-per-click (CPC):  If you want to focus on clicks on your ads and drive traffic to your website, you'll want to use CPC bidding. Cost-per-thousand impressions (CPM):  If you want to focus on impressions — the number of times your ad shows — and increase awareness of your brand, you'll want to use CPM bidding. Note that CPM bidding is available for Display Network campaigns only. Cost-per-acquisition (CPA):  If you want to focus on conversions — which is when people take a specific action on your website after clicking one of your ads — you'll want to use CPA bidding.

Google App Engine Java Threads

A Java application can create a new thread, but there are some restrictions on how to do it. These threads can't "outlive" the request that creates them. (On a backend server, an application can spawn a background thread, a thread that can "outlive" the request that creates it.) An application can Implement java.lang.Runnable; and Create a thread factory by calling com.google.appengine.api.ThreadManager.currentRequestThreadFactory() call the factory's newRequestThread method, passing in the Runnable, newRequestThread(runnable) or use the factory object returned by com.google.appengine.api.ThreadManager.currentRequestThreadFactory() with an ExecutorService (e.g., call Executors.newCachedThreadPool(factory)). However, you must use one of the methods on ThreadManager to create your threads. You cannot invoke new Thread() yourself or use the default thread factory. An application can perform operations against the current thread, such as thread.interrupt(). Eac...

How to fix com.google.appengine.api.datastore.DatastoreNeedIndexException in Google App Engine

If you encounter the following error on your Google App Engine web app: Error: Server Error The server encountered an error and could not complete your request. Please try again in 30 seconds. And in the app log: com.google.appengine.api.datastore.DatastoreNeedIndexException: The index for this query is not ready to serve. See the Datastore Indexes page in the Admin Console. The suggested index for this query is:     <datastore-index kind="Greeting" ancestor="true" source="manual">         <property name="date" direction="desc"/>     </datastore-index> To fix it: Put the index in your  datastore-indexes.xml  file located in your  WEB-INF  directory. The full xml file would look like: < ? xml version = " 1.0 " encoding = " utf-8 " ? > < datastore - indexes autoGenerate = " true " > < datastore - index kind = " Greeting " ancestor = " true " source = ...

Maven Google App Engine archetypes

Maven App Engine archetypes Maven Archetypes  allow users to create Maven projects using templates that cover common scenarios. App Engine takes advantage of this Maven feature to provide some useful  App Engine archetypes  at Maven Central. The current App Engine artifacts are listed in the table below: Application Type Artifact Description App Engine app* guestbook-archetype Generates the guestbook demo sample, complete and ready to run and test. App Engine app* appengine-skeleton-archetype Generates a new, empty App Engine project ready for your own classes and resources, but with required files and directories. Cloud Endpoints API backend hello-endpoints-archetype Generates a simple starter Cloud Endpoints backend API project, ready to build and run. Cloud Endpoints API backend endpoints-skeleton-archetype Generates a new, empty Cloud Endpoints backend API project ready for your own classes and resources, with required files and directories. *   App Engine app ...

Google App Engine Maven plugin goals

Name: A Maven Plugin for running and deploying appengine applications Description: The App Engine maven plugin which can be used to interact with   both the development server and the remote runtime. Group Id: com.google.appengine Artifact Id: appengine-maven-plugin Version: 1.9.37 Goal Prefix: appengine This plugin has 26 goals: appengine:backends_configure   Description: Configure the specified backend.   Implementation: com.google.appengine.appcfg.BackendsConfigure   Language: java   Before this mojo executes, it will call:     Phase: 'package'   Available parameters:     additionalParams       User property: appengine.additionalParams       Additional parameters to pass through to AppCfg.     append       User property: appengine.append       Append to existing file.     appId       User property: appengine.appId       Overri...