How to allow only IP address from a town to view a server - ip

I am trying to create a specific webpage, and I want to only allow people in my town to view it, so that later on I can expand on it and let surrounding towns view it. First, is this even possible, and second, if so, what language would be used to do this?

An IP address does not provide that kind of information but there are services out there that can "geolocate" an address based on information they've collected. I'm not sure how accurate it will be, though, so may not be able to identitify a specific town.

Related

How can I test website content from different US states

I am working on a website that has a set of regular content for pretty much everyone. A few US state governments do not like the phrasing/implications of some of the content and would like to make sure that their states' residents are not able to see the regular content at all. The trouble is that these states are not my home state.
Most VPN solutions that I've found are about spoofing your location to make it appear that you are in a different country, and while many might have server locations in more than one US state, they are not the state(s) that I'm targeting.
Other than traveling to those states, or knowing someone in those states, what kind of options exist to test content as if I'm a resident of another state? I'm essentially looking for a VPN that is (or can be) US state specific, or some equivalent process.
For example, I have a normal corporate VPN, but is it possible to have IT set up alternate VPNs based in those states, such that connecting to "VPN 1" or "VPN 2" would make my traffic appear to be from those places instead of my home state? Would AWS have any kind of service/product that could assist?
Since your server is using Geo-IP to determine location, I would simply add some testing IPs to the database and associate them to the locations that you want to test. That way, you can use the IPs that you can control and test your system at your convenience.
No VPNs or fancy routing needed.

How do Website like craigslist create content depending on the city your computer is located

I am looking to create a website that generates content depending on your city location. The best Example I found was Craigslit.They generate a web domain name like https://yourcity.craigslist.org/ when you either click on the city or it locates where you are. I was just wondering if I could get some help on how to build something like that.
The web pages are created using a template that doesn't change, populated with data that is selected from a database server, using your location to lookup appropriate items.
The subdomain (your city) is usually defined in the DNS record, just like www. There would be an entry for chicago.craigslist.org, for example.
edit
If you're asking how they know where you are, they can take a guess based on your IP address, however this isn't very reliable. Google does this also, when getting you search results that could be localized.
So yeah, it is expected of you to type some stuff into google to (try) find your answer (like detect city from javascript will bring up a lot of results for your problem.)
But yeah you would use a service like https://ipstack.com/ to detect where you live, depending on where you live the accuracy increases. (EU has some rules and regulations that make it a lot less accurate than if you would be living in the US)
Once you have a database with content - For example craigslist has a database of second hand items sold by people from all over. When you connect to craigslist they ask a service where your request came from - then use some filter function based on your location to match the results.
Good luck
Your IP address can be used to make an educated guess as to where you are, but it's not very accurate. When providing you with search results that might be localised, Google also does this.To know more about creating a website like craigslist follow here
https://www.yarddiant.com/blog/classifieds/how-to-build-a-website-like-craigslist.html

Geolocation of BGP Automous Systems

Hi friends I've been looking around for the past few days on a way to find the geolocation of the BGP AS's, preferably through the use of some API. I've been using the ripestat API for the majority of my work on this, but it comes up inconclusive on some of the AS's, for example AS 10000. RIPE tells me the location is in JP. Which is sort of fine, I just would like to narrow it down more to like a city / postal code / etc if possible. Is there another API suited for this? or is it just a manual task of fixing all the information once gathered.
Alternatively, if it is possible to grab the IP address of the actual AS itself, and not the range, that would likely work as well.
IP Geolocation isn't nearly accurate enough to pinpoint an IP to a specific City/ZIP code. In many cases, IPs from the same block will be used across a large area in an ISP's control, so it's not possible to be very accurate. Autonomous Systems don't really have "an IP", as there's no one specific location of them.
If you're looking for the locations where they peer to other providers, you might want to check out PeeringDB.

Google Analytics: How to anonymize GA tracking so that 'Region' is not known but 'Country' is still known?

Because of data privacy regulations (in Europe) we must not be able to locate an individual customer fro GA data.
Our application (which implements GA) is only used by a specific industry sector. Because of this in a given Region there may only be one customer.
So if we knew the Region we would often be able to locate the customer.
Now as a google analytics developer: How can I anonymize tracking so that region is not known but country is still known?
I am using GA anonymizeIP (which clears the IP's leat significant octet), but still from this anonymized IP I can get the Region.
Thanks in advance for any helpful Information.
Filters as suggested by #eike-pierstorff would work but it sounds like the customers might be larger companies so you might also need to neutralize the ISP/Network field which could identify the company more directly
Thanks for the comments.
Now this is my own solution:
Do IP Override and Geographical Override.
Now in order to set Geographical Override we would need to do get to know country on the client side.
For this a Geolocation webservice can be used (called by the Client App) the webservice would take the requesters IP and return the Country (from the IP) and the requesters IP.
The Client App would then mask the IP the way we like for IP Override and pass Country for Geographical Override.
There are Geolocation web-services providing the needed information - but probably not free of costs.
Alternatively we could implement such a Gelocation webservice ourselves, the implementation could incorporate a free version of GeoIPCountryWhois.csv.

how to spoof location so google autocomplete API will provide local results, ideally with R

google has an API for downloading search suggestions:
https://www.google.com/support/enterprise/static/gsa/docs/admin/70/gsa_doc_set/xml_reference/query_suggestion.html
unfortunately, as far as i can tell, these results are specific to your location. for an analysis, i would like to be able to define the city/location that google thinks it is making the suggestion to. here's what happens when i scrape from dar es salaam, tanzania:
http://suggestqueries.google.com/complete/search?client=firefox&q=insurance
["insurance",["insurance","insurance companies in tanzania","insurance group of tanzania","insurance principles","insurance act","insurance policy","insurance act tanzania","insurance act 2009","insurance definition","insurance industry in tanzania"]]
i understand that a vpn would partially solve this issue, but only by giving me a different location and not lots of locations. is there a reasonable way to replicate this sort of thing quickly and easily from, say, the 100 largest cities in the united states?
confirmation that results differ within the usa-
thanks!
Google will use your IP and your location history (if turned on) to determine your location.
To be able to go around it, you can spoof your IP while logged off your google account (but I don't know if google will consider it a trial of hacking no matter what your intentions are).
Another way is to use Tor browser (even though it is not it's original purpose). You can configure tor to exit from a certain country using the Exitnode parameter in the torrc config file
As found in the docs:
ExitNodes node,node,…
A list of identity fingerprints, country codes, and address patterns of nodes to use as exit node
But if you want a fast way to do it, I don't think that's possible since google wants to know the real location of the users and have put a lot of effort into making such tricks fail.
The hl param for interface language changes the search results, but I can't tell if it's actually changing the location. For example:
http://suggestqueries.google.com/complete/search?client=chrome&q=why&hl=FR
Here's an example with 5 different values of hl:
http://jsbin.com/tusacufaza/edit?js,output

Resources