Products Downloads


French version


 

[BEGIN_DECL]

NB4 Elements

NB4 Count

[END_DECL]

[BEGIN_INIT]

INITIALIZE WIN0

EXECUTE WIN0

[END_INIT]

[BEGIN_WINDOW WIN0]

[BEGIN_INIT]

/* Invokes the Web service

WS_CALL  GOOGLESEARCH doGoogleSearch 'GoogleAccountId' EF_STR_SEARCH: 0 10 *FALSE *BLANK *FALSE 'lang_en' *BLANK *BLANK

IF *RETURN_CODE = *normal

   /* Queries the complex result

   WS_GET_VAL GOOGLESEARCH doGoogleSearch /return/documentFiltering *TEXT CKB_FILTERING:

   WS_GET_VAL GOOGLESEARCH doGoogleSearch /return/estimatedTotalResultsCount    *TEXT OF_IS_RESCNT:

   WS_GET_VAL GOOGLESEARCH doGoogleSearch /return/searchQuery       *TEXT OF_SEARCH_QUERY:

   WS_GET_VAL GOOGLESEARCH doGoogleSearch /return/startIndex          *TEXT OF_START_INDEX:

   WS_GET_VAL GOOGLESEARCH doGoogleSearch /return/endIndex            *TEXT OF_STOP_INDEX:

   WS_GET_VAL GOOGLESEARCH doGoogleSearch /return/searchTips          *TEXT OF_SEARCH_TIPS:

   WS_GET_VAL GOOGLESEARCH doGoogleSearch /return/searchTime         *TEXT OF_SEARCH_TIME:

   /* Queries the number of results

   WS_COUNT_VAL GOOGLESEARCH doGoogleSearch /return/resultElements/# Elements

   /* Loop on results

   Count = 1

   DO_WHILE count <= Elements

      WS_GET_VAL GOOGLESEARCH doGoogleSearch /return/resultElements/#[count]/URL           *TEXT COL_URL:

      WS_GET_VAL GOOGLESEARCH doGoogleSearch /return/resultElements/#[count]/snippet       *TEXT COL_SNIPPET:

      WS_GET_VAL GOOGLESEARCH doGoogleSearch /return/resultElements/#[count]/title         *TEXT COL_TITLE:

      WS_GET_VAL GOOGLESEARCH doGoogleSearch /return/resultElements/#[count]/cachedSize    *TEXT COL_CACHEDSIZE:

      WS_GET_VAL GOOGLESEARCH doGoogleSearch /return/resultElements/#[count]/relatedInformationPresent *TEXT COL_RELATED:

      INSERT_ELT IDL_ELEMENTS:LIST

      count = count + 1

   REDO

END

/* Release of resources

WS_FREE_RESULT   GOOGLESEARCH doGoogleSearch

[END_INIT]


↑ Top of page

  • Aucune étiquette