Skip to content

Commit

Permalink
custom developer id adding, fixed bug with local storage during cance…
Browse files Browse the repository at this point in the history
…l email
  • Loading branch information
Sadzurami Cat authored and Sadzurami Cat committed Jun 20, 2022
1 parent 1a0ef01 commit a000af1
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 10 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Shows queries sent, time metrics in ms, errors text, etc.

[Official topic](https://community.bablosoft.com/topic/19063/kopeechkas-wrapper-around-kopeechka-store-api) on the Browser Automation Studio forum.

# Questions and suggestions
# Suggestions

If you have any questions or suggestions, please contact me:

Expand Down
5 changes: 3 additions & 2 deletions engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,11 @@ _KS = {
'regex',
'investor',
'subject',
'clear'
'clear',
'soft'
])

params.soft = '7'
params.soft = params.soft || '7'
params.clear = Number(params.clear) || 0
params.investor = Number(params.investor) || 0

Expand Down
2 changes: 1 addition & 1 deletion internal/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ _KS.request = {
var interval = Number(ctxt.interval) || 2000

var headers =
'User-Agent: KopeechkaSBAS/1.7\r\nAccept: application/json\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive'
'User-Agent: KopeechkaSBAS/1.8\r\nAccept: application/json\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive'

var response = null
var responseTime = null
Expand Down
7 changes: 4 additions & 3 deletions internal/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ function _KStorageLocal() {
}
_KStorageLocal.prototype = Object.create(_KStorage.prototype)
_KStorageLocal.prototype.set = function (key, value) {
return (this.db[md5(key)] = value)
this.db[md5(key)] = value
return void 0
}
_KStorageLocal.prototype.get = function (key) {
return this.db[md5(key)] || ''
return JSON.parse(JSON.stringify(this.db[md5(key)] || ''))
}
_KStorageLocal.prototype.remove = function (key) {
delete this.db[md5(key)]
return
return void 0
}

function _KStorageGlobal() {
Expand Down
1 change: 1 addition & 0 deletions ks_get_email_code.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ _call_function(_KS.getEmail, {
email: (<%= email %>),
regex: (<%= regex %>),
clear: (<%= clear %>),
soft: (<%= soft %>),
investor: (<%= investor %>),
timeout: (<%= timeout %>) * 1000,
interval: (<%= interval %>) * 1000,
Expand Down
14 changes: 14 additions & 0 deletions ks_get_email_interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,20 @@
]
}
}) %>
<%= _.template($('#input_constructor').html())({
id: "soft",
description: tr("Dev id"),
default_selector: "string",
value_string: "",
help: {
description: tr("Developer referral ID. You can find out about it in support."),
examples: [
{code: "55"},
{code: "101"},
{code: tr("leave blank"), description: tr("You have decided to share your money from lunches with the developer of this module. Thank you!")}
]
}
}) %>
<span data-preserve="true" data-preserve-type="check" data-preserve-id="clear">
<input type="checkbox" id="clear" style="margin-left:25px"/>
<label for="clear"><span class="tr">Exclude email addresses with special characters</span> <code>- . _ +</code></label>
Expand Down
4 changes: 3 additions & 1 deletion ks_get_email_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var sender = GetInputConstructorValue('sender', loader)
var subject = GetInputConstructorValue('subject', loader)
var email = GetInputConstructorValue('email', loader)
var regex = GetInputConstructorValue('regex', loader)
var soft = GetInputConstructorValue('soft', loader)

var clear = $('#clear').is(':checked')
var investor = $('#investor').is(':checked')
Expand All @@ -48,13 +49,14 @@ try {
subject: subject['updated'],
email: email['updated'],
regex: regex['updated'],
soft: soft['updated'],
clear: clear,
investor: investor,
strictMode: strictMode,
timeout: timeout['updated'],
maxTime: maxTime['updated'],
interval: interval['updated'],
variable: 'VAR_' + Save
variable: 'VAR_' + Save,
})
code = Normalize(code, 0)
BrowserAutomationStudio_Append(
Expand Down
13 changes: 11 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"ru": "Почты Kopeechka.store"
},
"major_version": 1,
"minor_version": 7,
"minor_version": 8,
"developer_name": "Sadzurami",
"developer_email": "[email protected]",
"developer_site": "https://community.bablosoft.com/user/sadzurami",
"developer_site": "https://github.com/Sadzurami",
"api_version": 1,
"actions": [
{
Expand Down Expand Up @@ -424,6 +424,15 @@
},
"Perform an action no more than 10 seconds.": {
"ru": "Выполнять действие не более 10 секунд."
},
"Dev id": {
"ru": "ID разработчика"
},
"Developer referral ID. You can find out about it in support.": {
"ru": "Реферальный идентификатор разработчика. Вы узнать о нём в поддержке."
},
"You have decided to share your money from lunches with the developer of this module. Thank you!": {
"ru": "Вы решили поделиться своими деньгами от обедов с разработчиком этого модуля. Спасибо!"
}
},
"browser": [],
Expand Down
Binary file added src-docs/.DS_Store
Binary file not shown.

0 comments on commit a000af1

Please sign in to comment.