Skip to content

Commit 0da0839

Browse files
committed
Merge branch 'feat/malicious-link-checker' into chore/all-my-stuffs
# Conflicts: # src/tools/index.ts
2 parents e897525 + 91a6038 commit 0da0839

File tree

4 files changed

+79
-1
lines changed

4 files changed

+79
-1
lines changed

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tools/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { tool as phpArrayToJson } from './php-array-to-json';
2525
import { tool as jsonSizeAnalyzer } from './json-size-analyzer';
2626
import { tool as jsonToCsharp } from './json-to-csharp';
2727
import { tool as luhnValidator } from './luhn-validator';
28+
import { tool as maliciousLinksTester } from './malicious-links-tester';
2829

2930
import { tool as cssXpathConverter } from './css-xpath-converter';
3031
import { tool as cssSelectorsMemo } from './css-selectors-memo';
@@ -220,6 +221,7 @@ export const toolsByCategory: ToolCategory[] = [
220221
jsUnobfuscator,
221222
jsonToPhpArray,
222223
phpArrayToJson,
224+
maliciousLinksTester,
223225
],
224226
},
225227
{
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { ShieldCheck } from '@vicons/tabler';
2+
import { defineTool } from '../tool';
3+
4+
export const tool = defineTool({
5+
name: 'Malicious Links Checker',
6+
path: '/malicious-links-checker',
7+
description: 'Check an url against Google Safe Browsing service',
8+
keywords: ['malicious', 'links', 'checker', 'check', 'safe', 'safe-browsing', 'google'],
9+
component: () => import('./malicious-links-checker.vue'),
10+
icon: ShieldCheck,
11+
createdAt: new Date('2024-05-11'),
12+
});
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<script setup lang="ts">
2+
import { request } from 'malicious-link-detector';
3+
import { useValidation } from '@/composable/validation';
4+
import { useQueryParam } from '@/composable/queryParams';
5+
6+
/*
7+
What tool do you want?
8+
Send Message via Whatsapp Web
9+
10+
Describe the solution you'd like
11+
I would like to have an input field where I can write a mobile number and a textfield, where I can send a message.
12+
A button "Send" which will open the follwowing url:
13+
14+
https://web.whatsapp.com/send/?phone=THE_MOBILE_NUMBER&text=THE_MESSAGE
15+
16+
it is important that the number is formatted correctly:
17+
the "0" at the beginning should be "49" (for germany) and all spaces or characters like "-" should be removed.
18+
*/
19+
20+
const url = useQueryParam({ name: 'url', defaultValue: '' });
21+
const urlValidation = useValidation({
22+
source: url,
23+
rules: [
24+
{
25+
message: 'Invalid url string',
26+
validator: (value) => {
27+
try {
28+
const _ = (new URL(value));
29+
return true;
30+
}
31+
catch {
32+
return false;
33+
}
34+
},
35+
},
36+
],
37+
});
38+
const result = computedAsync(async () => {
39+
const urlValue = url.value;
40+
return await request(urlValue);
41+
});
42+
</script>
43+
44+
<template>
45+
<div>
46+
<c-input-text
47+
v-model:value="url"
48+
label="Website url"
49+
placeholder="Put your website url here..."
50+
clearable
51+
mb-2
52+
:validation="urlValidation"
53+
/>
54+
55+
<c-alert v-if="result !== 'Safe'" type="error">
56+
Danger! '{{ url }}' website is listed as not safe by Google Safe Browsing: <strong>{{ result }}</strong>
57+
<c-alert />
58+
</c-alert>
59+
<c-alert v-if="result" type="success">
60+
This website is safe.
61+
<c-alert />
62+
</c-alert>
63+
</div>
64+
</template>

0 commit comments

Comments
 (0)