Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

AHK.net Website Gen 3.4


  • Please log in to reply
58 replies to this topic
Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
WARNING: THIS PROGRAM CURRENTLY DOES NOT WORK WITH THE LATEST FORUM UPGRADE. PLEASE WAIT FOR VERSION 3.5 FOR RESTORED FUNCTIONALITY.

Input your forum username into this script, and it will quickly generate a full website with descriptions, images, downloads, and links, automatically.

You can now follow development on GitHub.

Updates:

The AHK forums have had a huge upgrade, and as a result this script requires equally large changes. Version 3.4 includes the modifications needed to get back up and running with your AutoHotkey.net website.

Note for German users: In anticipation of an upgrade of the German forums, this version does not support the older layout that is in place currently. Please use version 3.3 until the German forums are upgraded.


Tweaks - blank password is now rejected, update for new AutoHotkey.net FTP username scheme, and fix for links in descriptions having their quotes HTML escaped.


Bugfixes - highlight being the topic cache, which was completely broken and therefore made page generation a lot slower.


Tweaks to behavior fix remaining bugs in uploading, properly handle special characters in descriptions, and more.


AutoHotkey.net Website Generator 3.0 is a complete rewrite. Now with a GUI, command line parameters, a templating engine, and more. The default templates, which were the only templates before, now have a few subtle changes that improve usability, such as a last changed date, the "Download" button showing only if there actually is a download link, and link-ified headers. Algorithms detecting the post description have also been modified and tweaked to make the process as automatic as possible. Uploading support is now fully functional.


AutoHotkey.net Website Generator 2.0 brings a refresh to the page design, allowing direct linking to a script listing on the website, as well as a more minimal layout that hides unneeded buttons. The generated markup is also structurally cleaner. The new, simpler styling system means that making new color schemes is now much easier, too.


Example:

AutoHotkey.net - Scripts

Screenshot:

Posted Image

Usage:

The script shows a GUI upon starting. If the Upload Website option is selected, the website will be automatically uploaded to AutoHotkey.net with the provided username and password. Otherwise, manually upload each file to your hosting provider.

See the README for more details such as the meaning of each option, command line parameters and template writing.

Download:

Version 3.4
Uncompiled script requires AutoHotkey v1.1+. Both compiled and uncompiled versions require Microsoft Windows XP or better.

Older versions are still available at the GitHub downloads page, although due to changes to the AutoHotkey.net website you will no longer be able to upload your websites using the script.

Edit: It's now AHK_L only, due to HTTPQuery issues. Sorry, AHK Basic users!
Edit: Caching support. See relevant post for details.
Edit: Version 2.0 is out! Recommended over original script for usability reasons.
Edit: Version 3.0 is out! Complete rewrite, many new features and much more flexible.
Edit: Bugfix release 3.1.
Edit: Bugfix release 3.2.
Edit: Bugfix release 3.3
Edit: Update release 3.4

tomoe_uehara
  • Members
  • 2166 posts
  • Last active: Jun 11 2015 05:33 PM
  • Joined: 05 Sep 2009
This is nice! 8)
A good script for those who doesn't understand how to make a decent ahk.net page, like myself
:lol:

codybear
  • Members
  • 600 posts
  • Last active: Feb 09 2015 12:41 PM
  • Joined: 15 Sep 2009

This is nice! 8)
A good script for those who doesn't understand how to make a decent ahk.net page, like myself
:lol:

Agreed! Very nice job man! (Or woman...just trying to be politically correct lol)!
Nonetheless looks good man! Will be handy for html/css/web design noobs!

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006
Thanks a lot for this!!

I was procrastinating making an AHK.net site, though i really wanted to. I even put up the basics, but finding and linking my posts put me off..

Wonderful! :)

Just a couple of points:
- This script does not work with AHK_L Unicode Win 32-bit Windows 7 (httpQuery fails). I used AHK Basic to run this script.
- The NoImage.jpg seems too large.
- The link span (a.main) is hidden by default, hence I cannot add any links in the description that pops up on hover. Could you just change the stylesheet so that only span is hidden. (i hope i am clear)..
- Firefox ignores background-size:120%;
- Why not add a "Done creating site" message box and then quit. I was waiting for it to finish.

Anyway, i modified it a bit to suit my needs.. and here is the brand new site

https://ahknet.autohotkey.com/~shajul/ 8)
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010

- This script does not work with AHK_L Unicode Win 32-bit Windows 7 (httpQuery fails). I used AHK Basic to run this script.


Ah yes, httpQuery. There doesn't seem to be a version that works on both AHK Basic and AHK_L, so I simply chose what I was familiar with, but HotkeyIt has taken the time to create an AHK_L version (it does require Struct() though). Simply replace the included httpQuery function with the desired version, and everything else should work.

- The NoImage.jpg seems too large.


Whoops, I forgot to actually upload the newest version of the site. :oops: The one that was previously up was really pretty out of date.

NoImage.jpg was also one of these files I had forgotten, it's been replaced with a custom made image, which fits better with the style, I think.

- The link span (a.main) is hidden by default, hence I cannot add any links in the description that pops up on hover. Could you just change the stylesheet so that only span is hidden. (i hope i am clear)..


Errr, I'm not quite sure I understand...

- Firefox ignores background-size:120%;


Added the -moz-background-size property. Sorry IE users, not even IE9 beta supports this...

- Why not add a "Done creating site" message box and then quit. I was waiting for it to finish.


Good idea! Added. Also made the FileSelectFile exit the script if Cancel is pressed.

Check up on the new version of the site! I've updated it to actually list all my scripts, including this one.

Other changes: the post title has been changed (so I don't have to correct layout issues when generating my site if the title is too long).

sumon
  • Moderators
  • 1317 posts
  • Last active: Dec 05 2016 10:14 PM
  • Joined: 18 May 2010
I request for this to be bumped. I love it (and recommend it!), but it doesn't find my scripts due to httpQuery not working. I removed the scripts' own HttpQuery function since I have an AHK_L (x86) version in my std lib, but still it doesn't work. It seems to just skip the parsing of the forum, and instead generates a new site.

By the way, what do I need to include when I upload my scripts for this parser to function correctly? Image, link to AHK.net *ahk file, anything else?

Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
I've updated the script to use my universal version of HTTPQuery. It should work on all versions of AHK now, although I haven't had the chance to test yet.

The script detects links to images and AHK.net links in your posts, as well as the descriptions (first paragraph of the post). The type of script (program or library) is detected from the presence of certain keywords. Therefore, to improve the quality of the generated site, try to include a single image (if there are multiple, the last one will be used), make the first paragraphs descriptive, and if the script is a library, try to mention the word "library" somewhere in the post or the subject, so it gets categorized properly.

Edit: It's working again!

maul.esel
  • Members
  • 790 posts
  • Last active: Jan 05 2013 09:26 PM
  • Joined: 28 Feb 2011
Do you have any working version, either for Basic or _L ?
I really need this wonderful work.:D

What changes would I have to make to use the german forum / both forums instead of the english one?

Regards
maul.esel
Join the discussion on The future of AutoHotkey
Posted Image Visit me on github Posted Image
Win7 HP SP1 64bit | AHK_L U 64bit

Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
Finally got around to fixing! Problem was with HTTPQuery, as I thought.

See my sig for proof! Also cleaned up the code a little bit.



Edit: Forgot to mention, it's now AHK_L only - I couldn't get HTTPQuery to work, so I had to use WinHttpRequest instead. Side effect is that the code is shorter :D. If enough people want it, I will try to fix up HTTPQuery to do work again.

Edit: Fixed typo. One more tip: try not to start posts off with a quote, it really messes the generated page up. HTML sanitizer may be added in the future, but avoid BBCode in the first paragraph for now.

maul.esel
  • Members
  • 790 posts
  • Last active: Jan 05 2013 09:26 PM
  • Joined: 28 Feb 2011
Thank you! This will help me a lot (as soon as I have any scripts to appear on the site :mrgreen:)

I changed it a little bit: [*:1ll8bka4]
FileSelectFolder, Folder, [color=red]*[/color]%A_ScriptDir%, 6, Select a folder to save the webpage to.
(To allow other directories than A_ScriptDir)

[*:1ll8bka4]
Sort Pages
as 3rd line in GeneratePage()

[*:1ll8bka4]I also changed SearchForPages() to accept an additional parameter:
Pages := SearchForPages(ForumUsername, "", "www")
Pages .= "`n" SearchForPages(ForumUsername, "", "de")
to search the german AND the english forum.

[*:1ll8bka4]I made the page "independant" of Style.css by altering GeneratePage():
[color=red]style := GetStyle(ColorScheme) ; ColorScheme global var
 StringReplace, style, style, margin-left: 31ex;[/color]
 If PageValidation
  ValidPage = `r`n<br>`r`n`r`n<p>`r`n%A_Tab%<a href="http://validator.w3.org/check?uri=http`%3A`%2F`%2Fwww.autohotkey.net`%2F~%AutoHotkeyNetUsername%`%2F;accept=application`%2Fxml`%2Capplication`%2Fxhtml`%2Bxml`%2Ctext`%2Fhtml`%3Bq`%3D0.9`%2Ctext`%2Fplain`%3Bq`%3D0.8`%2Cimage`%2Fpng`%2C`%2A`%2F`%2A`%3Bq`%3D0.5;accept-language=en-US`%2Cen`%3Bq`%3D0.8;accept-charset=ISO-8859-1`%2Cutf-8`%3Bq`%3D0.7`%2C`%2A`%3Bq`%3D0.3"><img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01 Strict"></a>`r`n%A_Tab%<a href="http://jigsaw.w3.org/css-validator/validator?uri=https://ahknet.autohotkey.com/~%AutoHotkeyNetUsername%/&profile=css3"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!"></a>`r`n</p>
 WebPage = <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">`r`n<html>`r`n<head>`r`n<meta http-equiv="Content-type" content="text/html;charset=UTF-8">`r`n[color=red]<style>%style%</style>[/color]`r`n<title>maul.esel - My Scripts</title>`r`n</head>`r`n`r`n<body>`r`n<p id="title">AutoHotkey</p>`r`n<p id="subtitle">Scripts and libraries by %ForumUsername%</p>`r`n<div id="content">`r`n<div class="list">`r`n<p class="section" id="Scripts">Scripts</p>`r`n%A_Tab%<table>`r`n%ScriptsTable%%A_Tab%</table></div>`r`n<br>`r`n`r`n<div class="list">`r`n<p class="section" id="Libraries">Libraries</p>`r`n%A_Tab%<table>`r`n%LibrariesTable%%A_Tab%</table></div>`r`n%ValidPage%`r`n`r`n</div>`r`n</body>`r`n</html>
 Return, WebPage
The idea is copied from mkdocs by majkinetor that ships with his NDocs custom installer
A question: GeneratePage() uses parameter AutoHotkeyNetPassword which is neither defined nor used anywhere in the code. Why?

Regards (and again thanks)
maul.esel
Join the discussion on The future of AutoHotkey
Posted Image Visit me on github Posted Image
Win7 HP SP1 64bit | AHK_L U 64bit

Frankie
  • Members
  • 2930 posts
  • Last active: Feb 05 2015 02:49 PM
  • Joined: 02 Nov 2008
The websites look great!

I'm trying to make one, but it gets hung up on "Searching pages from the AutoHotkey forum (50 topics processed)"

In recent lines it shows it's always sleeping for 4 seconds. That's this part of the code.
IfInString, Navigation, >Next<
 {
  RegExMatch(Navigation,"S)start=(\d+)[^""]*"">Next",Next)
  Sleep, 4000
 }

Tested on the latest AutoHotkey_L.

Edit: Also, the first MsgBox never shows.
aboutscriptappsscripts
Request Video Tutorials Here or View Current Tutorials on YouTube
Any code ⇈ above ⇈ requires AutoHotkey_L to run

Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
Thanks for all the suggestions and comments!

maul.esel: your suggestions have been added to the script. Thanks!

Frankie: sorry, that was a bug :oops:. It's been fixed now: I forgot that I commented out the '"&start=" . Temp1' part for debugging

There have been extensive updates:

[*:2o2wrpvc]Folder selection allows folders other than A_ScriptDir
[*:2o2wrpvc]Added option to support sorting of topics alphabetically
[*:2o2wrpvc]Full support for the German AutoHotkey forum, and options to enable and disable searching of both forums individually
[*:2o2wrpvc]Added option to include the CSS stylesheet right into the page (disabled by default because this technique does not let the browser cache the CSS properly)
[*:2o2wrpvc]Experimental AutoHotkey.net uploading support. Enable the option "UploadWebsite" to have your website automatically uploaded to AutoHotkey.net, through FTP.

Frankie
  • Members
  • 2930 posts
  • Last active: Feb 05 2015 02:49 PM
  • Joined: 02 Nov 2008
The link appears to be broken.

<!-- m -->https://ahknet.autoh... ... erator.ahk<!-- m -->
aboutscriptappsscripts
Request Video Tutorials Here or View Current Tutorials on YouTube
Any code ⇈ above ⇈ requires AutoHotkey_L to run

Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
Sorry; Fixed.

Frankie
  • Members
  • 2930 posts
  • Last active: Feb 05 2015 02:49 PM
  • Joined: 02 Nov 2008
Wow! Thats great! I'll play with it, and maybe upload a custom background but it simplifies the site process a lot and looks really nice.

Here's the link: <!-- m -->https://ahknet.autoh...y.com/~frankie/<!-- m --> (Also linked in signature)

Another satisfied customer :D

PS: I used the auto-upload option and it works with no problems. I just ran the script and went to my page without even logging in to my account.

Just curious, how do you know what's libraries and what's a script?
aboutscriptappsscripts
Request Video Tutorials Here or View Current Tutorials on YouTube
Any code ⇈ above ⇈ requires AutoHotkey_L to run