/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

Emacs

View

poast your fav cool websites

View

Give me one tech tip you know about

View

just installed Arch Linux bros

View

Urge to watch Mr. Robot Hindi dub

View

/cyb/+/psg/: Cyber-Punk/Security & Privacy

View

soyjak.st forum which hacked 4chin blocks all indi...

View

Have you discovered female luke smith yet?

View

View

Aarambh hai prachand..

View

OTG vs Microwave

View

which llm subscription is the best

View

Tell me all about indiachan/bharatchan lore

View

View

How do people who have a job get time to code on s...

View

Great time to be a /g/enius

View

Just found out linux foundation has their own free...

View

the best android browser has arrived!!

View

View

My ThinkPad arrived

View

(((Open)))ai playing new tricks

View

NEED ADVICE FROM true /g/entooman

View

View

Create something interesting with your skills now ...

View

View

Gonna make my own 34-key keyboard

View

View

which software on PC and mobile you use to handle ...

View

🦀🦀🦀🦀🦀

View

C++ Resources

View

View

Local Models General

View

GPT-5

View

View

What is shell programming

View

View

Libre Thinkpads

View

Computing

View

Tech Scams

View

Thinkpads are the best Laptops

View

View

M. tech. thesis suggestion,ideas.

View

View

Linux /gen/

View

Indian related AI discussion

View

privacy chuds gtfih

View

View

Best LLM model for coding and maths.

View

PuchAI

View

View

User extensions to Bharatchan

UP

L5etee

No.1096

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

Anonymous

IN

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.

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!