Need help with web script? Answered

I know a little about scripting web pages, but I'm mostly a hardware guy.  I need to figure out how to make certain text on a web page change based on where the client's location is.  (For instance, I need to say "serving (client town here) and the surrounding area since......." and I also need the phone number to change.  So far the best option I have come up with is creating a different web page for each town.  I know this script is possible, but I just don't know how to make it.  If anybody out there knows how to script this, I would help me a lot.  Thanks!

Question by thegeeke   |  last reply


E-mail Newsletter

I am unable to access interesting topics from the newsletter directly.  I get this message when I click on a link: "Due to the presence of characters known to be used in Cross Site Scripting attacks, access is forbidden. This web site does not allow Urls which might include embedded HTML tags." I am using a web mail (cox) and chrome.  Your e-mail doesn't have a link on top for "if you can't see this in your browser", which would be nice as going to the home page doesn't show the current e-mail information.  ie Sonic Screwdriver by MrTinkerer   I've never seen the above warning before and it doesn't sound like one I want to see.  ;-}

Topic by Metamorph   |  last reply


How to install a web script php / sql

Someone explain to me how to install a web script php / sql? Wait for response. Thanks a lot.

Question by Francesca Diamanti   |  last reply


Finally, Javascript & DOM more powerfull than what I thought ...

.Hi ...I needed to quickly code a tiny tool-application, but I did not want to spend days and nights learning the API of a new GUI (under linux), neither I wanted to fight with usual C/C++ bugs, memory leaks and crashes, neither I wanted to learn a new scripting language like Python or Perl ...I wanted to do simple and fast, and if possible using my current knowledges : my webbrowser would do the GUI, and PHP would be my programming language.At first sight, I did not consider Javascript as a serious (or main) option, because I've kept very bad memories from Internet Explorer that I mistakenly considered as "the reference" ... But Mozila based browsers are more compatible with W3C than IE !So, finally, to my great surprise, I've made my app-tool 100% client side .......................... I don't even need PHP.However, when I run it on IE, it does not work as expected .....And my question is : for the sake of compatibility, what's the best strategy ?1) "downgrading" the scripts to make them compatible with every targeted web-browsers ?2) writing several version of the scripts, one for each web-browser ?Dilemma ... Dilemma ...

Topic by chooseausername   |  last reply


How to make a search recpie by ingradant thing? Answered

I have no knowledge of this kind of stuff. however, I can use the computer very well, except for scripting + Html. i'm not using it for recipies. whoever helps me can possibbly work remotly together. scince i'm 13, you won't get paid, but it'll be fun! (if your 13 too or close 2 that, and my parents allow, we could work together, face2face.)

Question by milkywaybar   |  last reply


I can't get my my javascript code to work! Answered

I have been trying for days to get just the simplest of javascript working on my webpage but no matter what I try nothing happens. I am trying to display a button and then make a pop-up message when the user clicks it. I cannot stress how much frustration I have gone through just trying to make it do anything. I am writing it in mozilla Kompozer and testing it in mozilla Firefox. Here is the full code:

Question by dungeon runner   |  last reply


How can i improve my web dev skills is there any place i can practice?

I am good in web application development i know server side scripting language and dbms scripting. but i am not in practice from a while is there any site who serve as non-profit site so that i can help them with my skills or where can i get people who want their own personalised website and dont want to hire a programmer who take too much money.

Question by Atul009   |  last reply


Chrome open source browser available now!

At the moment, the only thing available for people anticipating Google's new open source browser, chrome, is screenshots and a comic book explaining why it was made. LinkyBut it is supposed to be available for download later today. Rumor is it will become available at 2 PM ET today. No word yet on whether it will steal your identity like Microsoft's IE.Hooray for opensource browsers! If it does become available today as planned, I'll link to the download page.Corrected link: Download linkSorry it took so long, I was scrubbing a toilet and simply lost track of the time...EDIT:Go here for adblocker, gmail, etc, GM scripts to run in chrome.

Topic by Lithium Rain   |  last reply


HTML HOST?

I have written a website using html , javascript , css , php and i want a service that allows me to host my code for free and create a website using it without making me use its own templates. Please I need help

Question by arv_christos   |  last reply


Control over Multiple Raspberry Pis GPIO with single web-interface, running on a computer

Hi, I want to control the GPIO 5 Raspberry Pis, using a single website (running locally on the pc). Is it as simple as writing a small script on each pi that waits for incoming commands (via the network)? Could someone point me in the right direction, possibly to a tutorial where they use a separate webpage (not using the pi as a web server) to control GPIO? Thanks 

Question by joearkay   |  last reply


Flash addon?

I remember a long whiles ago coming across some kind of script for firefox or safari to right click and disable certain flash banners on web sites, but not all of them. I was wondering if anyone can remember what the app was called as I can't. My issue are these retarded orbital sander ads on the front page, it keeps expanding across the page every time I visit the site here and laggs my safari for like 5 minutes until I can finally click at that close button (VERY frustrating).

Topic by Punkguyta 


LED disk monitor

I'm thinking of making an LED based hard drive monitor that will show the % of free space. My thoughts are either an Electric Imp or a Spark Particle wifi controller and then some kind of OSX script that runs  on my server to read the disk usage and push it to a web server. I'll be using APA102 or LPD8806 strips. Any thoughts or suggestions? Cheers.

Topic by filthyPhil   |  last reply


Where can find a free electronic circuit schematic drawing program? Answered

I have been looking on the web for some programs to use to draw circuit schematic and PCB. All the ones that I have found had problems such as them only being free for only one month or not working on mac computers. Could some one please give me a link to a website or program, and also I would prefer it to run on adobe flash or java script. thanks for the help.

Question by joe429437   |  last reply


home security system based on a gprs modem

Hello, I want to develop an ASP.Net web site using VB.Net for receiving data from a device. The device will send data to the server where the website is placed. My question is: can I write my script in VB.Net for getting the values from the device and displaying the same information into the web server database and how should i do this and also i want to do this through dynamic dns...is it possible..if yes then how will be the interfacing be done ? i have the code but im confused about the interfacing part... how do i interface with the gprs modem using j2me without using a pc...i want to use it to send a sms through the gprs modem in a home security system to a predefined mobile number... thank you...

Topic by hermionee   |  last reply


Any tips on executing code on a remote PC by sending a SMS message?

I want to be able to send an SMS from my cell phone to execute a script on my PC.   If possible, I'd like to be able to do this without any additional hardware.  I know I could connect a second cell phone to my PC via Bluetooth, but I'd like to avoid that if at all possible.  There must be some kind of web application designed specifically for this, but so far I've come up with nothing. Any suggestions?

Question by y9906   |  last reply


How do I edit a SQL database? Answered

Hey, I have recently found a clone of the Fiverr Script micro-jobs thing for free and I have no idea of how to set it up. I have set up the installation it says and step 2 says I need to import a file called 'scriptsolution.sql' into my newly created database. I know what this means, but how do I do this? I have setup a MySQL database on http://www.freesqldatabse.com/ and I don't know how to edit it. Then, step 3 says I need to upload some specified files into my web server's public directory and I have no idea on how to do that or what that means. Step 4 says I need to CHMOD 777 the files and directories that it shows, I have no idea what that means. Lastly, step 5 says 'Setup a cron job on your server to run once every hour of every day.' and it says the commend format, I sort of know what this means but I don't know how to do this. That's all I have questions abou so PLEASE HELP!!! Thanks!

Question by knexpert1700   |  last reply


Total Views Count - Update

Tomorrow will be the first time I've posted stats from my Total Views Count script since January. I had some problems with the script breaking and losing the data, then was very busy throughout February/March since I was at Instructables HQ as an Artist in Residence, then when I got home to the UK I didn't have the motivation to fix it. Well, I've now started work on it again and last Friday I ran it for the first time since January. Tomorrow I'll be running it again and will have a gain value for each group member to share with everyone. It's still not completely finished, below is a description of how it worked before, how I've changed it and what I'm going to change further. Skip to the last bit if you want to read what the group's going to change into. Where it was: I used to run the group once per week by opening a Perl script on my desktop computer. The script automatically visited each of your profiles and added the total views count to a new column in a spreadsheet. Instructables updated some code, my script got confused, didn't update the spreadsheet properly and so all the data went screwy. I had to then post a forum topic and hand out patches, it took a long time. Where it is now: I've rewritten the Perl script, it now saves the data to a MySQL database instead of a spreadsheet. It also gathers far more data: total views, number of instructables, comments total, best answers total, number of forum topics, number of subscribers. I have a web page that looks up the total views from that database and displays a list I can copy to a forum topic. I still have to run it manually like before but it's much less hassle. Where it's going: I have spent a few hours working on learning to get Perl scripts working on my personal website. I can now automatically run them once per day, which I didn't know how to do. I now need to: 1) Check that the total views script will run daily 2) Write functionality to patch automatically 3) Design more patches! Once I have total views patches sending automatically I would like to award people for the following:   Total Views: 10k, 25k, 50k, 100k, 250k, 500k, 1m Subscribers: 10, 25, 50, 100, 250, 500, 1000 Answers: 10, 25, 50, 100, 250, 500, 1000 Best Answers: 1, 5, 10, 25, 50, 100, 200, 300, 400, 500 Instructables: 1, 5, 10, 25, 50, 75, 100, 200 Comments: 50, 100, 250, 500, 1000, 2000, 3000 Subscriptions: The newest site update now lets me see how many people YOU'VE subscribed to. The more you subscribe to. You'll earn patches for more subscriptions. If you're arty and want to help out with this bit, please volunteer, it'll save me some time and they'll look prettier. The cartoons Caitlinsdad did for the total views patches were fantastic, but last time I asked he was too busy to design more. 4) Implement automatic sending out of all of the types of patches 5) Change the name of the group to reflect that it no longer really is just to show a list of total views. That's been surpassed when HQ added the baseball cards to profiles. Got a suggestion? Once done, the weekly forum topic that I post will become a pretty list of who's been awarded what patches. Let me know in the comments if you've got feature ideas you'd like to see implemented or want to help out. This group's been going 2 years now! Thanks! James

Topic by Jayefuu   |  last reply


4 New Pro Features - UPDATED - 1, 2 & 3 now complete!

As some of you may have seen, recently I've been playing with Perl to manipulate Instructables and gather data from profiles. More recently I developed these 3 perl scripts for use by the pro community. Since they proved fairly popular we thought we'd move them to the public forums so you can see what we've been up to. (By we I mean pro members, not staff, I'm not staff) I thought of 3 new potential features I could develop, this time only available to pros. The fourth you can read about below, it's more of a teaser for something Lithium_Rain and I are working on. 1) Download all own instructables: Backs up ALL of your instructables to your hard drive as pdfs. 2) Download all favourite instructables: Downloads all your favourite instructables! 3) Download all X's instructables: Big fan of Kiteman? Or Ewilhelm? Or Canida? Or even Jayefuu? *gasp**shock**horror*. Going away for a week? No problem. Download all of one person's instructables as pdfs in one easy step and be set for quality reading for the duration of your trip! 4) This is more of a teaser for a work in progress. It should be out in the next month if Lithium_Rain and I aren't too busy. It's more of a server run application that uses ibles to gather interesting data. More on this in a few weeks maybe. Using the Perl scripts  yourself: (you need to be a pro member) 1) Download Perl from www.cpan.org 2) Install Perl 3) Download WWW::Mechanize from www.cpan.org. This will let the script access instructables. It's used to fetch web pages. 4) Install Mechanize by extracting it into your Perl directory (or just follow the instructions included with it) 5) Download download_instructables_pdfs.pl or download_instructables_favourite_pdfs.pl from this forum thread and change the extension from .txt to .pl 6) Edit download_instructables_pdfs.pl. You will need to update your instructables account name and password so it can log in. The variable $target is the name of the instructabler you want to download the instructables of. Those are the only 3 things you need to change. If you like you can also edit the pdf properties to include comments, larger pictures and other things. Depending on the amount of ibles you're doing, it may take longer. It takes about 3 minutes to download my 17 ibles. Can't be bothered to install Perl but still want a copy of your instructables?: 1) Subscribe to me (for the effort it takes me to run the script) 2) PM me your email address and whether you want your instructables or your favourite instructables or both! 3) I'll run it for you and email you a zipped file containing your instructables. OR - wait a few weeks and Lithium_Rain and I might have a web interface ready. People who've had their ibles sent: Zieak, Goodhart, Kiteman, Jayefuu

Topic by Jayefuu   |  last reply


Hack my homepage?

Software security issues are often obvious to a second pair of eyes. I just posted the PHP scripts for my personal contact homepage as an instructable:Simple PHP personal contact homepage (web3.0!)Can you hack it? Preferably a copy on your local machine and not on my actual server... I deleted all my administration files and classes prior to making this post, just in case.I have two primary concerns:1. General PHP injection attacks. Proper handling and escaping of form data.2. The admin interface has a sessions based authentication mechanism. Login is compared to a MD5 hash of the password, then a session is created with an MD5 hash of the user's IP address. Each subsequent page load compares the authenticated session IP with the user's IP address (again, an MD5 of both). The goal is to prevent remote session stealing related flaws by tying the session to an (unknown...) IP address. Obviously if you have access to the local machine this is all moot, but there is little I can do about that. If an intruder were to get around the session authentication, they would be able to upload files just about anywhere on my server using the admin upload interface. This is a bit of a concern...I think in light of this, I'm going to add an option to limit the web admin interface to one IP address. My IP is fairly static, and if it changes, simply upload a new config file by ftp.

Topic by ian   |  last reply


Remote Access and Control for various Sensor Data and Output Devices

I am working on a project that involves multiple sensors as well as a handful of output devices, and am looking for the best solution on how to collect data from the sensors, have certain actions occur based off of the sensor input, as well as be able to have a web-accessible page where the logged data could be viewed. Additionally, I would also like to be able to modify certain variables (such as changing thresholds for when output devices are activated, for how long they are activated, etc) on the webpage. A very similar solution to a different situation that I am familiar with is OctoPrint. With OctoPrint, you can view your 3D printer live from the comfort of any machine on the network, as well as send custom commands to it, or even initiate prints. My application would be very similar to what OctoPrint offers, with the addition of being able to view collected data from sensors, as well as changing variables within scripts. The current hardware I plan on using consists of an Arduino as an analog to digital converter for the analog sensors, as well as the controller for relays and other output devices. The Arduino would be plugged into a Raspberry Pi (or really any machine would work, I think), which is essentially how an OctoPrint setup works. Ideally, I would like to have the Raspberry Pi act as the webserver/host (I would be the only individual accessing the webpage, so a pi should be enough for that? If another computer would be needed to host the webpage, then Ideally I would like to omit the pi altogether.)I would like the input data to be logged and displayed in a graphical manner, through graphs and charts. A friend recommended using a database, such as MySQL; is this a good option, or is there something that would be more efficient? The control/data page wouldn't necessarily need to be accessible to the world wide web, although that would be convenient (I would prefer not needing to pay for a domain though). So long as I could access it from the local network, that would suffice.If there is some program/software that allows me to do all/most of this, that'd be great. Otherwise, I'm just looking for input on what would be the most optimal route going about this. Ideally the less complicated the better, but I'm not afraid of learning new things.

Topic by RocketPenguin   |  last reply


Free Code: JSLoad!

UPDATE: JSLoad is now hosted on Google Code. You can find the most recent source, revision history, documentation, and can report bugs, there. What is JSLoad? JSLoad is a Javascript file loader that we wrote for Instructables. You give it a set of dependencies and groupings, and it loads the files you need, when your executing code needs them. We're releasing it under the LGPL because we're cool like that, and because we'd like to use any enhancements that other folks come up with. You can download the code at the bottom of this blog post, or check out the test file to see it in action. Why use JSLoad? Generally, we use dependency managers to avoid having to think about all the couplings that exist within our code. A widget we've made may need a whole mess of stuff -- all spread out between different files -- to run. Dependency managers allow us to say, "Give me everything I need for this widget to run," instead of having to figure it out for ourselves, each time, for each widget. Other, well-written javascript package managers exist (e.g. jspkg, YUI Loader, etc.) So why did we write a new one, and what reasons might you have for using it? In a nutshell, JSLoad is small, flexible, and is designed to work on its own, without the need for any heavyweight framework. How does JSLoad work? JSLoad does the basics: you tell it that file 1 depends on file 2, so it loads file 1 first, then file 2. Throw any number of other dependencies into the mix, and JSload figures out the dependency chain and loads the files in the right order. The real usefulness of JSLoad comes with its ability to group dependencies using tags. Tags are arbitrary labels that you can apply to (i.e. make dependent on) any group of files or other tags. Tags can be applied to single files or multiple files. Multiple tags can be applied to a single file. You can even think of your tags as depending upon a portion of a file (say, class within a file containing several classes.) As a result, you can mimic most other dependency structures: Chains, trees, or more complicated graphs. You can tag things that often appear together, that share a certain aspect; whatever your usage calls for. At Instructables, for example, we generally have a base set of widgets and features whose dependencies are primarily tree-like. Those little bits are then collected into larger groupings like "editable" or "commentable"; abstract labels that approximate the kinds of interfaces that are common on our site. Tags are also very useful while refactoring code. Often, because of the flexibility of Javascript, you won't be sure of the best way to split your code across files. Which portions will be used together most often, and should thus be grouped together to reduce HTTP requests? With JSLoad, you can tag the variant groupings, then organize your code as you wish. Your web pages will just call JSLoad the tags as they need them. Over time, you may find that one tag is used much more often than the others. Using JSLoad, you can refactor your code into a more efficient file structure, without changing any of the script calls in the pages that use the code. How is JSLoad used? Here is an example of how to instantiate a new instance of JSLoad: var jsLoader = new JSLoad(tags); JSLoad instances are intended to be singletons. JSLoad was designed to track state (which files have already been loaded, for example) in one central location. The "tags" variable passed to the JSLoad instance is a list of tag dependencies. Here is an example: var tags = [ { name : "baselib" }, { name : "widget", requires : ["baselib"] } ]; As you can see, "tags" is an array of objects, each defining a tag and its dependencies. In the above example, the "widget" tag depends on "baselib." An implicit part of the tags definition is that, by default (and for conciseness), tags refer to files. So, in the above example, the "baselib" refers to "baselib.js" and "widget" refers to "widget.js". If a tag doesn't actually refer to a file, but is an arbitrary grouping of your own design, you can set the "tagOnly" property of the tag to "true": var tags = [ { name : "baselib" }, { name : "widget", requires : ["baselib"] }, { name : "gadget", requires : ["baselib"] }, { name : "dostuff", requires : ["widget", "gadget"], tagOnly: true } ]; In this case, I've created a tagOnly tag called "dostuff." There isn't any actual file named "dostuff.js." Rather, the tag just indicates that it needs both "widget" and "gadget" (and, by implication, "baselib") to be loaded. All three will thus be loaded in the correct order if I ask for "dostuff." How do I ask for "dostuff"? Well, somewhere on my page, I might want to do stuff, and thus inline the following Javascript code: jsLoader.load(["dostuff"], function () { var widgie = new Widget(); var gadgie = new Gadget(); }); This tells my JSLoad singleton to run the anonymous function that is the second argument, and to do so as soon as the "dostuff" tag has all of its dependencies taken care of. I can make my load() calls at any point on the page, requiring any combination of tags, and I can repeat them; JSLoad will take care of creating HTTP requests to get the necessary files only once, only when necessary, and in the right order. You can download the code at the bottom of this blog post, or check out the test file to see it in action. The archive at the bottom of this blog post includes the test file, too. Limitations JSLoad has some limitations, due to its implementation. First of all, JSLoad runs asynchronously, to speed up load time on a page and to allow for nested iframes to load script into the top level context. As a result, if you inline dependent script in your page, JSLoad will need to wrap that script to ensure that it isn't executed before the necessary files are loaded. See "How JSLoad is used" above for details. Second, the list of dependencies you provide to JSLoad needs to be ordered. That means that no file or tag may depend on a file or tag that appears after it. This allows JSLoad to run faster, as it can calculate the dependency tree in one pass, and protects it (and you) from circular dependencies. We may remove these limitations in future versions, or at least parameterize them so you can decide which side of a trade-off you'd like to take advantage of. In the meantime, enjoy! And, if you have any comments or questions, please use the comment section below.

Topic by nagutron   |  last reply


How to make Flip Clock Numbers and build a "like"-counter around it?

Hey All So I've got this client, who's absolutely crazy about the "FLIKE" (A physical like counter.). But he can't have it for another couple of months, and he'd like it to be a little more custom... Long story short, I might end up making a similar product in a few weeks. it will probably consist out of 5 digits and if it's up to me (not sure what the client wants) I'd stuff them behind a long picture frame. Something like this but actually mechanical and not just a picture of it:  http://www.notonthehighstreet.com/thedriftingbear/product/personalised-framed-vintage-flip-clock-print So I started googling every hardware piece I needed and it turns out it's a huge pain to find Flip Clock Numbers / Flip Board Numbers... whatever you want to call them. (What's the right name btw?) You can't just buy these things, let alone in a custom size. So the idea is to build them myself. I found this on wikipedia, which gives a clue about the inside: http://en.wikipedia.org/wiki/File:Analog_clock_with_digital_display.png So I'm figuring out what needs to go in it to make this work. (I'll end up making an instructable about it) The numbers themselves are going to be made out of vinyl stickers. You can easily buy those from ebay in about any size if you look for them. The stickers will be put on to plastic boards. But I'm not totally sure what kind I should get. They should be thin and must be able to stand up straight, yet "easy" to fold. I'll probably get them lasercut, but you should be able to cut them by hand as well. Currently I'm thinking about gluing small metal or carbon rods on the back of those letters. Although I'm not sure if that would be strong enough. Would it be enough to file one side of the rods to get a bigger contact surface? (What do you guys think?) I'm planning of putting the half letters in a drum of ABS or PLA. it should be shaped like this:  |--------| I'm thinking about 3D printing this. But no idea how it'll do... One side of the drum will be connected to a small stepper motor (5.625° with 1/64 reduction). I don't have real experience with stepper motors, but this resolution seems more than sufficient. The other side will be connected to a metal or plastic positioner. Each digit might end up with it's own "unit" so I can swap them separately if they'd break. I've got great experience with lasercut plexi, so I might use that because it's more accurate than wood and I might have some lying around. I was first thinking about 1 stepper motor and a set of gears. I decided not to do that in the end because I don't have good experience with making gears and I can never find the right sizes online. Also, it'll make everything way more complex. So each motor will have it's own controller connected to it. Those controllers would have to talk to an ATMega or something. (I'm planning on using an arduino to prototype, but then just swap the chip and make a stand-alone version without usb etc) The ATMega has to be connected to the internet of course to get the current number of likes, so I'd connect it to a raspberry pi via I²C. I'm not familiar with the GPIO pins on the pi so I figured this would be a save and convenient way to handle this. The ATMega is robust, and I love the Arduino bootloader. A sketch is written in no time, but I have no idea how to start writhing this code for the GPIO pins. So why the Raspberry Pi? First off, this thing might end up being wireless, and since a wifi module for the arduino costs as much as a Pi, I figured this would be easier. The plan is to make the pi run python script that could ask the number of likes from the facebook API. Once returned, it'll send +1 or +5 or +10 over I²C. The arduino shifts the numbers to the correct position and replies with the total number it's displaying (3012 for instance). The PI can then recheck if everything is in sync. As for the set up. Since we have Pi, we can put on a LAMP stack (I know, this is overkill, but it wouldn't hurt either). So for initial set-up, we'd connect the counter to ethernet, browse to it on a different computer via "http://counter.local". And we'd be presented with a web interface. You'll be able to set the URL of the page u want to get the likes from, set and reset the number that is displayed on the counter, and the WIFI settings. The WIFI settings can be saved in the wpa_supplicant.conf file and on reboot it'll automatically connect to this network. From now on the whole system is manageable over wifi via a html interface. For debugging I might enable ssh though. So I guess you've got the whole outline now. I'd like to get your feedback on this! And this for the mechanics, electronics, and software side of things! 

Question by woutervddn   |  last reply