route=trolleybus: Cz:Tag:route=trolleybus
da:
key:
+ fee: Da:Key:fee
+ lit: Da:Key:lit
maxheight: Da:Key:maxheight
tag:
highway=tertiary: Da:Tag:highway=tertiary
leisure=sports_centre: Tag:leisure=sports centre
leisure=track: Tag:leisure=track
leisure=water_park: Tag:leisure=water park
+ man_made=compass_rose: Tag:man made=compass rose
man_made=crane: Tag:man made=crane
man_made=cutline: Tag:man made=cutline
man_made=dyke: Tag:man made=dyke
crossing: Ja:Key:crossing
cuisine: Ja:Key:cuisine
cycleway: Ja:Key:cycleway
+ electrified: Ja:Key:electrified
fixme: Ja:Key:fixme
foot: Ja:Key:foot
highway: Ja:Key:highway
operator: Ja:Key:operator
phone: Ja:Key:phone
power: Ja:Key:power
+ power_source: Ja:Key:power source
railway: Ja:Key:railway
ref: Ja:Key:ref
route: Ja:Key:route
tracktype: Ja:Key:tracktype
waterway: Ja:Key:waterway
wheelchair: Ja:Key:wheelchair
+ wikipedia: Ja:Key:wikipedia
wood: Ja:Key:wood
tag:
amenity=arts_centre: Ja:Tag:amenity=arts centre
amenity=baby_hatch: Ja:Tag:amenity=baby hatch
+ amenity=bus_station: Ja:Tag:amenity=bus station
amenity=cafe: Ja:Tag:amenity=cafe
amenity=drinking_water: Ja:Tag:amenity=drinking water
amenity=fast_food: Ja:Tag:amenity=fast food
amenity=toilets: Ja:Tag:amenity=toilets
amenity=vending_machine: Ja:Tag:amenity=vending machine
amenity=veterinary: Ja:Tag:amenity=veterinary
+ barrier=lift_gate: Ja:Tag:barrier=lift gate
highway=crossing: Ja:Tag:highway=crossing
highway=footway: Ja:Tag:highway=footway
highway=pedestrian: Ja:Tag:highway=pedestrian
historic=archaeological_site: Ja:Tag:historic=archaeological site
landuse=forest: Ja:Tag:landuse=forest
landuse=wood: Ja:Tag:landuse=wood
+ leisure=dog_park: Ja:Tag:leisure=dog park
leisure=ice_rink: Ja:Tag:leisure=ice rink
man_made=lighthouse: Ja:Tag:man made=lighthouse
natural=coastline: Ja:Tag:natural=coastline
natural=wood: Ja:Tag:natural=wood
+ power=generator: Ja:Tag:power=generator
railway=crossing: Ja:Tag:railway=crossing
railway=level_crossing: Ja:Tag:railway=level crossing
railway=rail: Ja:Tag:railway=rail
+ railway=station: Ja:Tag:railway=station
shop=doityourself: Ja:Tag:shop=doityourself
+ shop=motorcycle: Ja:Tag:shop=motorcycle
shop=outdoor: Ja:Tag:shop=outdoor
tourism=hotel: Ja:Tag:tourism=hotel
tourism=information: Ja:Tag:tourism=information
# On --help
help() if $help;
-help() unless $ARGV[0];
+my $out_file = $ARGV[0];
+$out_file //= 'config/wiki_pages.yml';
+
+help() unless -f $out_file;
# Get a API interface
my $mw = MediaWiki::API->new();
ok(1, "Got a total of $count{$_} ${_}s") for qw[ key value ];
# Dump to .yml file
-open my $out, ">", $ARGV[0] or die "Can't open file '$ARGV[0]' supplied on the command line";
+open my $out, ">", $out_file or die "Can't open file '$out_file' supplied on the command line";
say $out "# THIS FILE IS AUTOGENERATED WITH THE script/misc/update-wiki-pages";
say $out "# PROGRAM DO NOT MANUALLY EDIT IT";
say $out "";
--- /dev/null
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../config/environment'
+require 'generator'
+
+addresses = User.count(
+ :conditions => {
+ :status => ["suspended", "deleted"],
+ :creation_time => Time.now - 28.days .. Time.now
+ },
+ :group => :creation_ip
+)
+
+addresses.each do |address,count|
+ if count > 2
+ acl = Acl.find(:first, :conditions => {
+ :address => address,
+ :netmask => "255.255.255.255"
+ })
+
+ unless acl
+ Acl.create(
+ :address => address,
+ :netmask => "255.255.255.255",
+ :k => "no_account",
+ :v => "auto_spam_block"
+ )
+
+ puts "Blocked #{address}"
+ end
+ end
+end
+
+acls = Acl.find(:all, :conditions => {
+ :netmask => "255.255.255.255",
+ :k => "no_account_creation",
+ :v => "auto_spam_block"
+})
+
+acls.each do |acl|
+ unless addresses[acl.address]
+ acl.delete
+
+ puts "Unblocked #{acl.address}"
+ end
+end
+
+exit 0