/g/ - Technology

Board dedicated to discussions related to everyday technology!

0/4000

BharatChan Disclaimer

Notice

Before proceeding, please read and understand the following:

1. BharatChan is a user-generated content platform. The site owners do not claim responsibility for posts made by users.

2. By accessing this website, you acknowledge that content may not be suitable for all audiences.

3. You must follow BharatChan’s community guidelines and rules. Failure to do so may result in a ban.

4. By using BharatChan users agree to the use of cookies, mostly for session related to user.

A poster on BharatChan must abide by the following rules:

Sitewide Rules
You must be 18 or older to post.
Sharing personal details or engaging in doxing is strictly prohibited.
Political discussions should be confined to /pol/.
NSFW content is only allowed in /kama/.
Off-topic discussions, thread derailment, or spam may result in a ban and IP blacklist.
Pornographic content is strictly prohibited.
Any activity violating local laws is not allowed.
Acknowledge

Recent Posts

User extensions to Bharatchan

View

View

IDE's should be the norm

View

View

Mac vs PC

View

View

बिना वीपीएन के टाॅरेण्ट डाउनलेड कर लिया

View

View

cock.li in distress

View

This book is my geeta

View

View

Firefox is more unoptimized than chrome

View

b-bros just installed arch linux

View

liquid glass more like liquid -

View

Aarambh hai prachand..

View

Can anyone bomb his WhatsApp or fuck his phone up ...

View

Every software is open source of you know assembly

View

View

Placement

View

Can Quantum Computers Actually Beat Humans, or Are...

View

He was right

View

View

alternative frontends

View

View

Daily Reminder

View

Gaymes on Linux

View

Apple WWDC 25 Event

View

friendship ended with xfce now kde is my best frie...

View

opensuse appreciation thread

View

View

Billions must commit env in main

View

All you ever need

View

View

View

View

any xfce users here?

View

google gave me free access to gemini 2.5 pro

View

View

just installed Arch Linux bros

View

View

View

Recommend me a no nonsense browser

View

View

AI wrote 90% of the code at microsoft

View

View

Working on my game in a late night game dev sessio...

View

skills

View

Good lua scripts for MPVplayer?

View

Sketch - A simple 2D graphics library in C

View

View

User extensions to Bharatchan

UP

L5etee

No.1096

User scripts or themes or anything else you have made for Bharatchan.

Anonymous

ROJR

t7rh0e

No.1097

>>1096(OP)

motivanon had made one for filters, we have a custom css support now - there's a dedicated thread on /g/ check

duck made pretty cool one, another by i think someone in /gen/

nepali anon

IN

vU1ohB

No.1285

"Script" to download all the media files from a thread. Doesn't support thread watching and other features. Or even checking already downloaded files.

NOTE: Powershell

NOTE: Use if you just want to download all the files from a thread just as they are (except when multiple files with the same name exist, then a count index is prefixed in front of the title)

# edit these $board = "b" $thread_id = 146229 # patterns $post_container_pattern = '<div class="post-container-group">.*' $image_links_pattern = '<a\s+href="([^"]+)"\s+title="([^"]+)"\s+target="_blank">' $thread_url = "https://bharatchan.com/board/$board/thread/$thread_id" $html_content = (Invoke-WebRequest -Uri $thread_url).Content $desired_block = [regex]::Match($html_content, $post_container_pattern).Value $mediaFiles = [regex]::Matches($desired_block, $image_links_pattern); # total of 2 gropus # 0 -> full match # 1 -> url path # 2 -> title foreach ($file in $mediaFiles) { $url_path = $file.Groups[1].Value $title = $file.Groups[2].Value # check if file with "title" already exists. # if it does, make a new title if (Test-Path $title) { $count = 1 $new_title = "$count-$title" while (Test-Path $new_title) { $count++ $new_title = "$count-$title" } $title = $new_title } # declare the download link variable and download the media file. $file_url = "https://bharatchan.com" + $url_path try { Invoke-WebRequest -Uri $file_url -OutFile $title Write-Host "Downloaded file: $title"; } catch { Write-Host "Kuch hogya yaar. Debug karna padega phirse. T_T" Write-Host "Error: $_.Exception.Message" } }

Feedback much appreciated.

!lmOJk15ILR6OW/a

RJ

ZOS/Bd

No.1311

Bura Mat Dekho Bharatchan Filter (Chrome plugin)

Actually filters out posts. Matches for even names in replies. (Current bhch filters don't do it and we will have to wait for the next bhch update for that I guess)

Two ways to do it.

1. Download it and use it

2. Copy paste the source and stuff yourself.

Download

Link: Expires in 20 days. Normal file upload things such as Mediafire didn't work on my BSNL/Jio connection.

https://limewire.com/d/beImd#RA7ncMvgnP

---------------

Do it yourself.

Step 1: Make a folder, name it anything.

I named mine 'bharatchan-filter'

Download Picrels

Save them as:

icon16.png

icon48.png

icon128.png

hidden.png

Next, make 4 empty files, name them:

content.js

manifest.json

popup.html

popup.js

---

content.js

chrome.storage.sync.get("filterWords", (data) => { const filterWords = data.filterWords || []; // Check if filterWords is empty or contains only spaces const validFilterWords = filterWords .map(word => word.trim()) // Trim spaces around each word .filter(word => word.length > 0); // Remove empty strings if (validFilterWords.length > 0) { // Function to toggle hiding of a post const hidePost = (post) => { // Create a placeholder image element const placeholderImage = document.createElement("img"); placeholderImage.src = chrome.runtime.getURL("hidden.png"); placeholderImage.alt = "hidden"; placeholderImage.style.cursor = "pointer"; placeholderImage.style.width = "100px"; placeholderImage.style.height = "100px"; // Hide original post content and images const mediaContainer = post.querySelector(".post-media-container"); if (mediaContainer) { // Hide media container and insert placeholder image mediaContainer.style.display = "none"; mediaContainer.parentNode.insertBefore(placeholderImage, mediaContainer); } const content = post.querySelector(".post-content"); if (content) content.style.display = "none"; // Set click event to unhide the post placeholderImage.onclick = () => { placeholderImage.remove(); if (mediaContainer) mediaContainer.style.display = "block"; if (content) content.style.display = "block"; }; }; // Check all posts and apply filtering document.querySelectorAll(".post").forEach((post) => { const text = post.innerText.toLowerCase(); // Only hide posts that contain any of the valid filter words if (validFilterWords.some(word => text.includes(word.toLowerCase()))) { hidePost(post); } }); } });

manifest.json

{ "manifest_version": 3, "name": "Bura Mat Dekho: Bharatchan Filter", "version": "1.0", "description": "Filter posts containing specific letter combinations on bharatchan.com", "permissions": ["storage"], "host_permissions": ["https://bharatchan.com/*"], "content_scripts": [ { "matches": ["https://bharatchan.com/*"], "js": ["content.js"] } ], "action": { "default_popup": "popup.html", "default_icon": { "16": "icon16.png", "48": "icon48.png", "128": "icon128.png" } }, "web_accessible_resources": [ { "resources": ["hidden.png"], "matches": ["<all_urls>"] } ] }

popup.html

<!DOCTYPE html> <html> <head><title>Bharatchan Filter Settings</title></head> <body> <h3>Edit Filter Words</h3> <textarea id="filterWords" rows="10" cols="30"></textarea> <button id="saveBtn">Save</button> <script src="popup.js"></script> </body> </html>

popup.js

document.getElementById("saveBtn").addEventListener("click", () => { const filterWords = document.getElementById("filterWords").value.split(","); chrome.storage.sync.set({ filterWords }, () => { alert("Filter words saved!"); }); }); window.onload = () => { chrome.storage.sync.get("filterWords", (data) => { document.getElementById("filterWords").value = data.filterWords ? data.filterWords.join(",") : ""; }); };

Save the files, close them.

Now, your folder should look like this:

-/bharatchan-filter/

|

|/content.js

|/hidden.png

|/icon16.png

|/icon48.png

|/icon128.png

|/manifest.json

|/popup.html

|/popup.js

zip them all to get:

bharatchan-filter.zip

Go to chrome plugins, upload and enable the plugin, stick it on the hotbar.

Set your filter words, separated by commas.

Click save.

Done!