GSA Search Engine Ranker API <- simple HTTP server
Clone or download
seospace
seospace license
Latest commit 418eb6f Jan 31, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
consumers ser base Jan 20, 2018
help first Jan 19, 2018
utils sublime-snippets Jan 20, 2018
.gitattributes Initial commit Jan 19, 2018
.gitignore ser base Jan 20, 2018
LICENSE license Jan 31, 2018
README.md first Jan 19, 2018
config.json first Jan 19, 2018
gsapi_server.py first Jan 19, 2018
hosts first Jan 19, 2018
install.py first Jan 19, 2018
requirements.txt first Jan 19, 2018
tests_gsapi.py first Jan 19, 2018

README.md

gsapi

Simple HTTP server for GSA Search Engine Ranker.
It makes possible to integrate 3rd party tools or custom coded scripts instead of using script-manual .

Created mainly to integrate ZennoPoster templates.

How to install:

  1. Download and install Python 3.6.3+
  2. Download repo and run install.py
  3. Run gsapi_server.py
  4. Add to your C:\Windows\System32\drivers\etc\hosts file this line:
  • 127.0.0.1 gsapi.local

How does it work?

  1. Create your new engine, using cookiecutter, lets call this engine "example.com":

  1. Paste your new engine into SER /engines/ folder.
  2. Run your project:

  1. You have script that will create link for you (for example Zennoposter)
  2. To know if there's a pending task to create a link, your script will requests endpoint:
{
  "results": {
    "data": "{\"engine_name\": \"example.com\", \"target_url\": \"http://example.com\", \"url\": \"http://google.com\"}",
    "link_id": 1
  },
  "success": true
}

  1. In case there are no tasks, you will receive:

{
  "results": "No tasks for example.com",
  "success": false
}
  1. In case you need an article, or something else, just edit your example.com.ini file:

That's what your consumer will see:

{
  "results": {
    "data": "{\"engine_name\": \"example.com\", \"target_url\": \"http://example.com\", \"url\": \"http://google.com\", \"some_variable\": \"some data\"}",
    "link_id": 2
  },
  "success": true
}

  1. After your script (for example Zennoposter template) builds a link, you just simply have to tell gsapi location of the link:
{
  "results": {
    "data": "{\"engine_name\": \"example.com\", \"target_url\": \"http://example.com\", \"url\": \"http://google.com\", \"some_variable\": \"some data\"}",
    "link_id": 2
  },
  "success": true
}

  1. Now SER will be redirected to http://google.com:

  1. In case your script (ZennoPoster template) get's wrong (ex. your internet connection is down, BAD END), you can set the link_id to "not working", so it can be consumed again, simply call this endpoint:
{
  "results": {
    "data": "{\"engine_name\": \"example.com\", \"target_url\": \"http://example.com\", \"url\": \"http://google.com\"}",
    "link_id": 1
  },
  "success": true
}

helpfull commands and tools:

  • cmder
  • cd .. && rm -r example.com && cookiecutter . && cd example.com && python paste_into_gsa.py