Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions content/geoip/geolocate-an-ip/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ Install-Package MaxMind.GeoIP2
<dependency>
<groupId>com.maxmind.geoip2</groupId>
<artifactId>geoip2</artifactId>
<version>5.0.2</version>
<version>5.1.0</version>
</dependency>

// Or install via Gradle
repositories {
mavenCentral()
}
dependencies {
implementation 'com.maxmind.geoip2:geoip2:5.0.2'
implementation 'com.maxmind.geoip2:geoip2:5.1.0'
}
```

Expand Down Expand Up @@ -117,7 +117,7 @@ System.out.println(country.isoCode());

```javascript
// Asynchronous database opening
const Reader = require('@maxmind/geoip2-node').Reader;
import { Reader } from '@maxmind/geoip2-node';

Reader.open('/path/to/maxmind-database.mmdb').then((reader) => {
const response = reader.city('128.101.101.101');
Expand All @@ -126,10 +126,10 @@ Reader.open('/path/to/maxmind-database.mmdb').then((reader) => {
});

// Synchronous database opening
const fs = require('fs');
const Reader = require('@maxmind/geoip2-node').Reader;
import { readFileSync } from 'node:fs';
import { Reader } from '@maxmind/geoip2-node';

const dbBuffer = fs.readFileSync('/path/to/maxmind-database.mmdb');
const dbBuffer = readFileSync('/path/to/maxmind-database.mmdb');

// This reader object should be reused across lookups as creation of it is
// expensive.
Expand Down
12 changes: 4 additions & 8 deletions content/geoip/geolocate-an-ip/web-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ Install-Package MaxMind.GeoIP2
<dependency>
<groupId>com.maxmind.geoip2</groupId>
<artifactId>geoip2</artifactId>
<version>5.0.2</version>
<version>5.1.0</version>
</dependency>

// Or install via Gradle
repositories {
mavenCentral()
}
dependencies {
implementation 'com.maxmind.geoip2:geoip2:5.0.2'
implementation 'com.maxmind.geoip2:geoip2:5.1.0'
}
```

Expand Down Expand Up @@ -105,9 +105,7 @@ WebServiceClient client = new WebServiceClient.Builder(accountId, licenseKey)
```

```javascript
const WebServiceClient = require('@maxmind/geoip2-node').WebServiceClient;
// TypeScript:
// import { WebServiceClient } from '@maxmind/geoip2-node';
import { WebServiceClient } from '@maxmind/geoip2-node';

const accountId = '10';
const licenseKey = 'LICENSEKEY';
Expand Down Expand Up @@ -234,9 +232,7 @@ try (WebServiceClient client = new WebServiceClient.Builder(accountId, licenseKe
```

```javascript
const WebServiceClient = require('@maxmind/geoip2-node').WebServiceClient;
// Typescript:
// import { WebServiceClient } from '@maxmind/geoip2-node';
import { WebServiceClient } from '@maxmind/geoip2-node';

const accountId = '10';
const licenseKey = 'LICENSEKEY';
Expand Down
5 changes: 2 additions & 3 deletions content/minfraud/evaluate-a-transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ Install-Package MaxMind.MinFraud
<dependency>
<groupId>com.maxmind.minfraud</groupId>
<artifactId>minfraud</artifactId>
<version>4.2.0</version>
<version>4.3.0</version>
</dependency>

// Or install via Gradle
repositories {
mavenCentral()
}
dependencies {
implementation 'com.maxmind.minfraud:minfraud:4.2.0'
implementation 'com.maxmind.minfraud:minfraud:4.3.0'
}
```

Expand Down Expand Up @@ -797,7 +797,6 @@ System.out.println(client.score(request));
```javascript
import { URL } from 'url'; // Used for order.referrerUri
import * as minFraud from '@maxmind/minfraud-api-node';
// const minFraud = require('@maxmind/minfraud-api-node');

// client is reusable
const client = new minFraud.Client('1234', 'LICENSEKEY');
Expand Down
8 changes: 4 additions & 4 deletions content/minfraud/proxy-detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ else {
```

```python
#!/usr/bin/env python
#!/usr/bin/env python3

import argparse
import requests
Expand All @@ -253,10 +253,10 @@ if 'err' in proxy and len(proxy['err']):
sys.stderr.write("MaxMind returned an error code for the request: %s\n" % proxy['err'])
sys.exit(1)
else:
print "\nMaxMind Proxy data for %s\n\n" % args.ip
print("\nMaxMind Proxy data for %s\n" % args.ip)
for (key, val) in proxy.items():
print " %-20s %s" % (key, val)
print "\n"
print(" %-20s %s" % (key, val))
print("")
```

```php
Expand Down
4 changes: 2 additions & 2 deletions content/minfraud/report-a-transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ Install-Package MaxMind.MinFraud
<dependency>
<groupId>com.maxmind.minfraud</groupId>
<artifactId>minfraud</artifactId>
<version>4.2.0</version>
<version>4.3.0</version>
</dependency>

// Or install via Gradle
repositories {
mavenCentral()
}
dependencies {
implementation 'com.maxmind.minfraud:minfraud:4.2.0'
implementation 'com.maxmind.minfraud:minfraud:4.3.0'
}
```

Expand Down