Skip to content

Commit

Permalink
2.16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jammmmm committed Jan 9, 2024
1 parent 5049eab commit d28f4fc
Show file tree
Hide file tree
Showing 14 changed files with 114 additions and 23 deletions.
6 changes: 5 additions & 1 deletion BUILD-INSTRUCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ To build the package for production (compiled javascripts and single jar) :

Assuming no errors occurred, the .jar file will be located at **web\target\serposcope.jar**.

### UPGRADING
## ERRORS

If you get errors such as *"package com.serphacker.serposcope.querybuilder does not exist"*, ensure you have run sqlcodegen (.sh or .bat) first.

## UPGRADING

This fork does not contain installation files, so install from 2.15.0 (if required) and then do the following to upgrade.

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# serposcope changelog

## 2.16.1 - 2024-01-08
* Added "Display Graphs" button onto groups table page to display a small ranking graph for each search.

## 2.16.0 - 2024-01-01
* Forked from [original 2.x Serposcope](https://github.com/serphacker/serposcope). Although the code still refers to the project as Serposcope, the project has been renamed from "Serposcope" to "Serposcope Fork" to avoid confusion.
* Updated version number from 2.15.0 to 2.16.0.
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.serphacker.serposcope</groupId>
<artifactId>serposcope</artifactId>
<version>2.16.0</version>
<version>2.16.1</version>
</parent>
<artifactId>core</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM java:8-jre

ARG SERPOSCOPE_VERSION

ENV SERPOSCOPE_VERSION ${SERPOSCOPE_VERSION:-2.16.0}
ENV SERPOSCOPE_VERSION ${SERPOSCOPE_VERSION:-2.16.1}

COPY serposcope /etc/default/serposcope
RUN wget https://serposcope.serphacker.com/download/${SERPOSCOPE_VERSION}/serposcope_${SERPOSCOPE_VERSION}_all.deb -O /tmp/serposcope.deb
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.serphacker.serposcope</groupId>
<artifactId>serposcope</artifactId>
<version>2.16.0</version>
<version>2.16.1</version>
<packaging>pom</packaging>
<name>serposcope fork</name>
<description>serposcope SEO rank checker</description>
Expand Down
2 changes: 1 addition & 1 deletion scraper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.serphacker.serposcope</groupId>
<artifactId>serposcope</artifactId>
<version>2.16.0</version>
<version>2.16.1</version>
</parent>
<artifactId>scraper</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>serposcope</artifactId>
<groupId>com.serphacker.serposcope</groupId>
<version>2.16.0</version>
<version>2.16.1</version>
</parent>

<artifactId>web</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions web/src/main/java/assets/css/google.css
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ MIT License (MIT) - Copyright (c) 2015 SERP Hacker https://serphacker.com/
padding: 5px 5px;
}

.display-graphs {
position: absolute;
right: 15px;
}

#google-target-chart {
border-width: 1px 1px 0px 1px;
border-color: lightgray;
Expand Down
4 changes: 4 additions & 0 deletions web/src/main/java/assets/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ body {
white-space: nowrap;
}

.displaynone {
display: none;
}

.inline {
display: inline;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ serposcope.googleTargetControllerGrid = function () {

var UNRANKED = 32767;
var COL_WIDTH = 21;

var COL_ID = 0;
var COL_SEARCH = 1;
var COL_SEARCH_KEYWORD = 0;
Expand Down Expand Up @@ -84,6 +84,7 @@ serposcope.googleTargetControllerGrid = function () {
$(".ajax-loader").remove();
data = json[0];
days = json[1];
setRankList (data);
renderGrid();
}).fail(function (err) {
$(".ajax-loader").remove();
Expand All @@ -102,7 +103,7 @@ serposcope.googleTargetControllerGrid = function () {
var columns = [{
id: "search",
name: '<div class="header-search" >&nbsp;&nbsp;Searches <i class="glyphicon glyphicon-sort" ></i></div>',
field: "id", width: 250, formatter: formatSearchCell, sortable: true
field: "id", width: 250+100, formatter: formatSearchCell, sortable: true /* Additional 100 in width for graph which gets with generateRankListGraph () */
}];
for (var i = 0; i < days.length; i++) {
var day = days[i];
Expand Down Expand Up @@ -315,9 +316,67 @@ serposcope.googleTargetControllerGrid = function () {
'>' + rankText + '</div>';
};

var setRankList = function (data)
{
var ranklist = {};

/* Get the list of ranks for the keywords */
if (typeof data != 'undefined' && data.length > 0)
{
for (var c = 0; c < data.length; c++)
{
if (typeof data[c] == 'object' && data[c].length > 0 && typeof data[c][0] != 'undefined')
{
var keywordid = parseInt (data[c][0]);
if (keywordid > 0 && typeof data[c][3] == 'object' && data[c][3].length > 0)
{
ranklist[keywordid] = [];

var rankvalue = 0;
data[c][3].forEach (function (i)
{
rankvalue = (typeof i == 'object' && i.length > 0 && typeof i[0] != 'undefined' && parseInt (i[0]) != UNRANKED && parseInt (i[0]) > 0) ? parseInt (i[0]) : 0;
ranklist[keywordid].push (rankvalue);
});
}
}
}
}

$('#rank_list').text (JSON.stringify (ranklist));
};

var generateRankListGraph = function ()
{
$('.sparkline_rank_graph').remove ();

if ($('#rank_list').text () !== '')
{
var rank_list = JSON.parse ($('#rank_list').text ());
$('#google-target-table-container .slick-viewport .slick-row').each (function ()
{
var href = $(this).find ($("a[href*='\/search\/'")).attr ('href');
if (typeof href != 'undefined' && href !== '')
{
var keywordid = href.match (/\/search\/([0-9]+)/);
if (keywordid != null && typeof keywordid != 'undefined' && keywordid.length > 0 && keywordid[1] != null && typeof keywordid[1] != 'undefined' && keywordid[1] !== '')
{
keywordid = parseInt (keywordid[1]);
if (keywordid > 0 && typeof rank_list[keywordid] != 'undefined' && rank_list[keywordid].length > 0)
{
$(this).find ('.slick-cell .text-left').prepend ($('<div class="inline sparkline_rank_graph" id="sparkline_graph_' + keywordid + '"></div>'));
$('#sparkline_graph_' + keywordid).sparkline (rank_list[keywordid],{width: "100"});
}
}
}
});
}
};

var oPublic = {
resize: resize,
render: render
render: render,
generateRankListGraph: generateRankListGraph
};

return oPublic;
Expand Down
2 changes: 1 addition & 1 deletion web/src/main/java/serposcope/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class Version implements Comparable<Version> {

private final static Pattern PATTERN = Pattern.compile("^([0-9]+)\\.([0-9]+)\\.([0-9]+)(-[A-Z]+[0-9]+)?$");
public final static Version CURRENT = new Version("2.16.0");
public final static Version CURRENT = new Version("2.16.1");

int major;
int minor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,13 @@ protected void getTableJson(
LocalDate endDate,
Writer writer
) throws IOException {
/* Format of each row
Index 0 = id
Index 1 = [keyword,country,device,local,data_center,custom_params]
Index 2 = [best_rank,best_rank_date,url]
Index 3 = rank or [rank,previous_rank (32767 if no rank),url]
*/

writer.append("[[[-1, 0, 0, [");
if (runs.isEmpty() || searches.isEmpty()) {
writer.append("]]],[]]");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<#import "targetLayout.ftl.html" as layout>
<@layout.googleTargetLayout >
<#include "../../helpers/search-filter.ftl.html" />
<div id="rank_list" class="displaynone"></div>
<div id="google-target-table-container" class="top5">
<img class="ajax-loader" src="/assets/img/loader.gif" />
</div>
Expand Down
34 changes: 21 additions & 13 deletions web/src/main/java/serposcope/views/helpers/search-filter.ftl.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<div class="search-filter">
<input id="filter-keyword" class="form-control inline width250 input-sm" placeholder="${i18n("label.keyword")}" />
<select id="filter-device" class="form-control inline width120 input-sm">
<option value="">${i18n("label.allDevices")}</option>
<option value="D">${i18n("label.desktop")}</option>
<option value="M">${i18n("label.mobile")}</option>
</select>
<input id="filter-country" class="form-control inline width120 input-sm" placeholder="Country" />
<input id="filter-local" class="form-control inline width120 input-sm" placeholder="${i18n("label.local")}" />
<input id="filter-datacenter" class="form-control inline width120 input-sm" placeholder="${i18n("label.datacenter")}" />
<input id="filter-custom" class="form-control inline width120 input-sm" placeholder="${i18n("label.custom")}" />
<button id="filter-apply" class="btn btn-primary btn-sm" >${i18n("label.filter")}</button>
<button id="filter-reset" class="btn btn-default btn-sm" >${i18n("label.reset")}</button>
<div>
<div class="search-filter inline-block">
<input id="filter-keyword" class="form-control inline width250 input-sm" placeholder="${i18n("label.keyword")}" />
<select id="filter-device" class="form-control inline width120 input-sm">
<option value="">${i18n("label.allDevices")}</option>
<option value="D">${i18n("label.desktop")}</option>
<option value="M">${i18n("label.mobile")}</option>
</select>
<input id="filter-country" class="form-control inline width120 input-sm" placeholder="Country" />
<input id="filter-local" class="form-control inline width120 input-sm" placeholder="${i18n("label.local")}" />
<input id="filter-datacenter" class="form-control inline width120 input-sm" placeholder="${i18n("label.datacenter")}" />
<input id="filter-custom" class="form-control inline width120 input-sm" placeholder="${i18n("label.custom")}" />
<button id="filter-apply" class="btn btn-primary btn-sm" >${i18n("label.filter")}</button>
<button id="filter-reset" class="btn btn-default btn-sm" >${i18n("label.reset")}</button>
</div>

<#if display == "table">
<div class="display-graphs inline-block">
<input type="button" onclick="javascript:serposcope.googleTargetControllerGrid.generateRankListGraph ();" value="Display Graphs" class="btn btn-primary btn-sm" />
</div>
</#if>
</div>

0 comments on commit d28f4fc

Please sign in to comment.