Содержание

Array CheckPages

Used to check the availability of the various pages before running the task.

May be considered as a property of the root object, or a property of one of the Item objects

Structure

"CheckPages":[
  {
    "Page":"<aPage>",
    "ExpectedIP":"<aExpectedIP>",
    "IncludedText":"<aIncludedText>",
    "UserAgent":"<aUserAgent>"
  },
  {
    "Page":"<aPage>",
    "ExpectedIP":"<aExpectedIP_2>",
    "IncludedText":"<aIncludedText_2>",
    "UserAgent":"<aUserAgent_2>"
  },
  ...
  {
    "Page":"<aPage>",
    "ExpectedIP":"<aExpectedIP_N>",
    "IncludedText":"<aIncludedText_N>",
    "UserAgent":"<aUserAgent_N>"
  }
]

Attributes

Attribute Use Presence
<aPage>verifiable page Required
<aExpectedIP>alleged IP host pageOptional
<aIncludedText>text which contained in the page source code Optional
<aUserAgent>User-agent, is used to download the source code of the checked pageOptional

Description

If non-empty array CheckPages was detected in an external source , then before the task will be executed, the availability of pages will be checked in accordance with the elements of the array.

Checking of pages is executing in several stages:

  1. If the host where the page located is available.
  2. If the host IP coincides with aExpectedIP or aExpectedIP and equal '0.0.0.0'.
  3. If AIncludedText not empty string, the source code of the page is loaded using aUserAgent (redirects are not supported!). If aUserAgent is empty, then used User-agent, installed for your browser. If the source code of the page contains aIncludedText or aIncludedText - empty string.

No more than five first pages will checked. If the checking at each stage is successful, the task continues to execute, otherwise the task is terminated.

Examples

  1. {
      "Items":[
      ...
      ],
      "CheckPages":[
        {
          "Page":"habrahabr.ru"
        }
      ]
    }
  2. {
      "Items":[
      ...
      ],
      "CheckPages":[
        {
          "Page":"habrahabr.ru",
          "ExpectedIP":"178.248.233.33"
        }
      ]
    }
  3. {
      "Items":[
        {
          ...
          "CheckPages":[
            {
              "Page":"habrahabr.ru",
              "ExpectedIP":"178.248.233.33"
            }
          ]
          ...
        }
      ]
    }