mirror of
https://github.com/towfiqi/serpbear
synced 2025-06-26 18:15:54 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7446b7868a | ||
|
|
be4db26316 | ||
|
|
9fa80cf609 | ||
|
|
5acbe181ec | ||
|
|
a45237b230 | ||
|
|
79b99a3896 | ||
|
|
4da725167e | ||
|
|
ddd10909ad |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -2,6 +2,20 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [0.1.3](https://github.com/towfiqi/serpbear/compare/v0.1.2...v0.1.3) (2022-12-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Adds a search field in Country select field. ([be4db26](https://github.com/towfiqi/serpbear/commit/be4db26316e7522f567a4ce6fc27e0a0f73f89f2)), closes [#2](https://github.com/towfiqi/serpbear/issues/2)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* could not add 2 character domains. ([5acbe18](https://github.com/towfiqi/serpbear/commit/5acbe181ec978b50b588af378d17fb3070c241d1)), closes [#1](https://github.com/towfiqi/serpbear/issues/1)
|
||||
* license location. ([a45237b](https://github.com/towfiqi/serpbear/commit/a45237b230a9830461cf7fccd4c717235112713b))
|
||||
* No hint on how to add multiple keywords. ([9fa80cf](https://github.com/towfiqi/serpbear/commit/9fa80cf6098854d2a5bd5a8202aa0fd6886d1ba0)), closes [#3](https://github.com/towfiqi/serpbear/issues/3)
|
||||
|
||||
### 0.1.2 (2022-11-30)
|
||||
|
||||
|
||||
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 Amruth Pillai
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
SerpBear is an Open Source Search Engine Position Tracking App. It allows you to track your website's keyword positions in Google and get notified of their positions.
|
||||
|
||||
#### [Documentation](https://docs.serpbear.com/)
|
||||
|
||||

|
||||
|
||||
**Features**
|
||||
@@ -12,10 +14,10 @@ SerpBear is an Open Source Search Engine Position Tracking App. It allows you to
|
||||
- **Mobile App:** Add the PWA app to your mobile for a better mobile experience.
|
||||
- **Zero Cost to RUN:** Run the App on mogenius.com or Fly.io for free.
|
||||
|
||||
**How it Works**
|
||||
#### How it Works
|
||||
The App uses third party website scrapers like ScrapingAnt, ScrapingRobot or Your given Proxy ips to scrape google search results to see if your domain appears in the search result for the given keyword.
|
||||
|
||||
**Getting Started**
|
||||
#### Getting Started
|
||||
- **Step 1:** Deploy & Run the App.
|
||||
- **Step 2:** Access your App and Login.
|
||||
- **Step 3:** Add your First domain.
|
||||
|
||||
@@ -30,7 +30,9 @@ const SelectField = (props: SelectFieldProps) => {
|
||||
flags = false,
|
||||
emptyMsg = '' } = props;
|
||||
|
||||
const [showOptions, setShowOptions] = useState(false);
|
||||
const [showOptions, setShowOptions] = useState<boolean>(false);
|
||||
const [filterInput, setFilterInput] = useState<string>('');
|
||||
const [filterdOptions, setFilterdOptions] = useState<SelectionOption[]>([]);
|
||||
|
||||
const selectedLabels = useMemo(() => {
|
||||
return options.reduce((acc:string[], item:SelectionOption) :string[] => {
|
||||
@@ -51,6 +53,18 @@ const SelectField = (props: SelectFieldProps) => {
|
||||
if (!multiple) { setShowOptions(false); }
|
||||
};
|
||||
|
||||
const filterOptions = (event:React.FormEvent<HTMLInputElement>) => {
|
||||
setFilterInput(event.currentTarget.value);
|
||||
const filteredItems:SelectionOption[] = [];
|
||||
const userVal = event.currentTarget.value.toLowerCase();
|
||||
options.forEach((option:SelectionOption) => {
|
||||
if (flags ? option.label.toLowerCase().startsWith(userVal) : option.label.toLowerCase().includes(userVal)) {
|
||||
filteredItems.push(option);
|
||||
}
|
||||
});
|
||||
setFilterdOptions(filteredItems);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="select font-semibold text-gray-500">
|
||||
<div
|
||||
@@ -68,8 +82,19 @@ const SelectField = (props: SelectFieldProps) => {
|
||||
<div
|
||||
className={`select_list mt-1 border absolute min-w-[${minWidth}px]
|
||||
${rounded === 'rounded-3xl' ? 'rounded-lg' : rounded} max-h-${maxHeight} bg-white z-50 overflow-y-auto styled-scrollbar`}>
|
||||
{options.length > 20 && (
|
||||
<div className=''>
|
||||
<input
|
||||
className=' border-b-[1px] p-3 w-full focus:outline-0 focus:border-blue-100'
|
||||
type="text"
|
||||
placeholder='Search..'
|
||||
onChange={filterOptions}
|
||||
value={filterInput}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<ul>
|
||||
{options.map((opt) => {
|
||||
{(options.length > 20 && filterdOptions.length > 0 && filterInput ? filterdOptions : options).map((opt) => {
|
||||
const itemActive = selected.includes(opt.value);
|
||||
return (
|
||||
<li
|
||||
|
||||
@@ -13,7 +13,7 @@ const AddDomain = ({ closeModal }: AddDomainProps) => {
|
||||
|
||||
const addDomain = () => {
|
||||
// console.log('ADD NEW DOMAIN', newDomain);
|
||||
if (/^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$/.test(newDomain)) {
|
||||
if (/^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+$/.test(newDomain)) {
|
||||
setNewDomainError(false);
|
||||
// TODO: Domain Action
|
||||
addMutate(newDomain);
|
||||
|
||||
@@ -49,7 +49,7 @@ const AddKeywords = ({ closeModal, domain, keywords }: AddKeywordsProps) => {
|
||||
<div>
|
||||
<textarea
|
||||
className='w-full h-40 border rounded border-gray-200 p-4 outline-none focus:border-indigo-300'
|
||||
placeholder='Type or Paste Keywords here...'
|
||||
placeholder="Type or Paste Keywords here. Insert Each keyword in a New line."
|
||||
value={newKeywordsData.keywords}
|
||||
onChange={(e) => setNewKeywordsData({ ...newKeywordsData, keywords: e.target.value })}>
|
||||
</textarea>
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "serpbear",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "serpbear",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"dependencies": {
|
||||
"@testing-library/react": "^13.4.0",
|
||||
"@types/react-transition-group": "^4.4.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "serpbear",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -98,9 +98,6 @@ const generateEmail = async (domainName:string, keywords:KeywordType[]) : Promis
|
||||
.replace('{{stat}}', stat)
|
||||
.replace('{{preheader}}', stat);
|
||||
|
||||
// const writePath = path.join(__dirname, '..', 'email', 'email_update.html');
|
||||
// await writeFile(writePath, updatedEmail, {encoding:'utf-8'});
|
||||
|
||||
return updatedEmail;
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ const refreshKeywords = async (keywords:KeywordType[], settings:SettingsType): P
|
||||
|
||||
const end = performance.now();
|
||||
console.log(`time taken: ${end - start}ms`);
|
||||
// console.log('refreshedResults: ', refreshedResults);
|
||||
return refreshedResults;
|
||||
};
|
||||
|
||||
|
||||
@@ -112,7 +112,6 @@ export const scrapeKeywordFromGoogle = async (keyword:KeywordType, settings:Sett
|
||||
}
|
||||
} catch (error:any) {
|
||||
console.log('#### SCRAPE ERROR: ', keyword.keyword, error?.code, error?.response?.status, error?.response?.data, error);
|
||||
// If Failed, Send back the original Keyword
|
||||
}
|
||||
|
||||
return refreshedResults;
|
||||
@@ -148,7 +147,6 @@ export const extractScrapedResult = (content:string, scraper_type:string): Searc
|
||||
const url = $(searchResult[i]).find('a').attr('href');
|
||||
if (title && url) {
|
||||
extractedResult.push({ title, url, position: i });
|
||||
// console.log(i, ' ',title, ' ', url);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -182,7 +180,6 @@ export const retryScrape = async (keywordID: number) : Promise<void> => {
|
||||
if (!keywordID) { return; }
|
||||
let currentQueue: number[] = [];
|
||||
|
||||
// const filePath = path.join(__dirname, '..', '..', '..', '..', 'data', 'failed_queue.json');
|
||||
const filePath = `${process.cwd()}/data/failed_queue.json`;
|
||||
const currentQueueRaw = await readFile(filePath, { encoding: 'utf-8' }).catch((err) => { console.log(err); return '[]'; });
|
||||
currentQueue = JSON.parse(currentQueueRaw);
|
||||
@@ -203,7 +200,6 @@ export const removeFromRetryQueue = async (keywordID: number) : Promise<void> =>
|
||||
if (!keywordID) { return; }
|
||||
let currentQueue: number[] = [];
|
||||
|
||||
// const filePath = path.join(__dirname, '..', '..', '..', '..', 'data', 'failed_queue.json');
|
||||
const filePath = `${process.cwd()}/data/failed_queue.json`;
|
||||
const currentQueueRaw = await readFile(filePath, { encoding: 'utf-8' }).catch((err) => { console.log(err); return '[]'; });
|
||||
currentQueue = JSON.parse(currentQueueRaw);
|
||||
|
||||
Reference in New Issue
Block a user