Update a site.
The user must be authenticated and have write permissions to the site.
Request
The request object has the following fields:
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
Yes |
The identifier of the site to update. |
|
|
String |
No |
Site name. Maximum 32 characters. |
|
|
String |
No |
Site URL. Should specify a URL that represents the site. Maximum 250 characters. See also /site . |
|
|
String |
No |
Site country code. Should specify the ISO 3166-1 alpha-2 code associated with the site. |
|
|
String |
No |
Site time zone identifier. Should be specified using the full name from IANA time zone database (e.g., "America/Los_Angeles") or a GMT offset (e.g., "GMT-08:00"). |
|
|
Boolean |
No |
(Experimental) Defines if the site should use sentiment analysis to detect negative content. See this page for more information about the feature. |
|
|
Boolean |
No |
When enabled urls will be automatically crawled as events are received. Defaults to enabled, can be disabled for sites where crawling is triggered using /profile/content/push or documents are updated using /document/update . |
|
|
String |
No |
Language to use for content processing. If not set language will be automatically detected according to the top level domain of the processed url and/or the content. |
|
|
Array of String |
No |
See /site . |
|
|
Array of Crawling Rules |
No |
See /site . |
Fields that are not specified will not be updated. To clear a string field, set it to an empty string.
Take note: If automaticCrawling has been disabled, you will need to do a /profile/content/push of your site's top level domain (e.g. http://www.yoursitehere.com) to force site verification.
Response
The response object has the following fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
Identifier for the updated site. |
|
|
String |
Site name. |
|
|
String |
Site URL. Should specify an URL that represents the site. |
|
|
String |
Site country code. Should specify the ISO 3166-1 alpha-2 associated with the site. |
|
|
String |
Site time zone identifier. Should be specified using the full name from IANA time zone database (e.g. "America/Los_Angeles") or a GMT offset (e.g. "GMT-08:00"). |
|
|
Boolean |
(Experimental) If Sentiment Analysis for more details. |
|
|
Boolean |
If false, no automatic crawling will be performed. See /document/update and /profile/content/push for how to manually update content for the site. |
|
|
String |
Language to use for content processing. If not set language will be automatically detected according to the top level domain of the processed url and/or the content. |
|
|
Array of String |
Cookie strings the crawler will set in the browser before loading a page. Each according to https://tools.ietf.org/html/rfc6265#section-4.1.1 with required domain attribute. The only difference from this rfc is that in order for cookie to be applied to subdomains, it must have a leading dot (e.g ".domain.com"). |
|
|
Array of Crawling Rules |
Rules for adding meta tags to a page during crawling, see below. |
|
|
String |
The creation time. Only available for customer admin ( |
|
|
String |
User name of person who created user. Only available for customer admin ( |
|
|
String |
The last changing time. Only available for customer admin ( |
|
|
String |
User name of last person who modified user. Only available for customer admin ( |
The url field is also used for verification purposes when creating a site search index. The validation occurs on top private domain, e.g., foo.com, foo.co.jp, or foo.co.uk. The top private domain is extracted from the url field and documents under that are allowed to enter the index. It is not currently possible to configure specific subdomains or subpaths, e.g., foo.com/bar/, for site search purposes. Note that the url field has to be where the site is actually hosted and not a redirect link. E.g., if you have a site example.com that redirects to example.othersite.com then othersite.com is the correct value.
Crawling rules
Each Crawling Rule is an object with the following fields
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
Yes |
A meta tag will be created with this name and content from the sources, if any of the sources have a value. At most 100 characters. |
|
|
Array of Sources |
Yes |
A list of sources. The first source that has a value will be used. |
Each Source is an object with the following fields
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
Yes |
One of |
|
|
String |
Yes |
The name of the source meta tag, javascript variable or expression, or cookie, depending on type. At most 100 characters. |
|
|
String |
No |
The string by which the data should be split. |
Examples
$ python cx.py /site/update '{"siteId":"9222300742735526873","name":"New example site"}'
{
"id": "9222300742735526873"
"name": "New example site",
"url": "https://www.example.com",
"country": "US",
"timeZone": "America/Los_Angeles",
}
$ python cx.py /site/update '{"siteId":"9222300742735526873","crawlingRules":[{"target":"test","sources":[{"name":"jsKey","type":"javascript", "dataSeparator":"."}]]}'
{
"id": "9222300742735526873"
"name": "New example site",
"url": "https://www.example.com",
"country": "US",
"timeZone": "America/Los_Angeles",
"crawlingRules": [
{
"target": "test",
"sources": [
{
"type": "jsKey",
"name": "javascript",
"dataSeparator": "."
}
]
}
],
}
Exclude rule examples
Strict correspondence of the article address. Exclude url equals http://example.com/article/123
{
"sources": [
{
"type": "ignore",
"name": "http://example.com/article/123"
}
]
}
Non-strict correspondence of the article address. Exclude all urls contains http://example.com/article/123
{
"sources": [
{
"type": "ignore",
"name": "http://example.com/article/123*"
}
]
}