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.
- Download and install Python 3.6.3+
- Download repo and run
install.py
- Run
gsapi_server.py
- Add to your C:\Windows\System32\drivers\etc\hosts file this line:
127.0.0.1 gsapi.local
- Create your new engine, using cookiecutter, lets call this engine "example.com":
- Paste your new engine into SER /engines/ folder.
- Run your project:
- You have script that will create link for you (for example Zennoposter)
- 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
}
- In case there are no tasks, you will receive:
{
"results": "No tasks for example.com",
"success": false
}
- 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
}
- After your script (for example Zennoposter template) builds a link, you just simply have to tell gsapi location of the link:
- for example, if your
link_id is 2
and the url where SER can find url for project ishttp:/google.com
, you have to urlencode your link, and send HTTP GET requests to this endpoint: - http://gsapi.local:9090/api/link/set_redirect/2/http%3A%2F%2Fgoogle.com
{
"results": {
"data": "{\"engine_name\": \"example.com\", \"target_url\": \"http://example.com\", \"url\": \"http://google.com\", \"some_variable\": \"some data\"}",
"link_id": 2
},
"success": true
}
- Now SER will be redirected to http://google.com:
- 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
}
- cmder
cd .. && rm -r example.com && cookiecutter . && cd example.com && python paste_into_gsa.py