Skip to content
/ alter Public

Adding alt attributes to your img tags because you're too lazy to do so

Notifications You must be signed in to change notification settings

faizanv/alter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text

Adding alt attributes to your img tags because you're too lazy to do so #CalHacks3.0

What?

Basically a script that will take in some HTML, find all the img tags with no alt text, then use Microsoft Cognitive Services to fill those in with a description of the image

Usage

mv keys.example.py keys.py

Replace ocp-apim-subscription-key in keys.py with your api key for Microsoft Cognitive Services

python main.py siteUrl rootUrl outputFileName.html
  • siteUrl is the webpage HTML you want to grab
  • rootUrl is the base url for which image relative paths are used on the website (normally the homepage)
  • outFileName.html is the name of the file that the script will output with the filled in alt texts

Example

  python main.py http://debkbanerji.com/ http://debkbanerji.com/ output.html
  ```

About

Adding alt attributes to your img tags because you're too lazy to do so

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages