-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
46 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
## 1.1.0+3 | ||
|
||
- Improved documentation. | ||
- Bumped year in the license. | ||
|
||
## 1.1.0+2 | ||
|
||
- Updated package description. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
import 'package:robots_txt/robots_txt.dart'; | ||
|
||
Future main() async { | ||
// Create an instance of the `robots.txt` parser | ||
// Create an instance of the `robots.txt` parser. | ||
final robots = Robots(host: 'https://github.com/'); | ||
// Read the ruleset of the website | ||
// Read the ruleset of the website. | ||
await robots.read(); | ||
// Print the ruleset | ||
// Print the ruleset. | ||
for (final ruleset in robots.rulesets) { | ||
// Print the user-agent the ruleset applies to | ||
// Print the user-agent the ruleset applies to. | ||
print(ruleset.appliesTo); | ||
if (ruleset.allows.isNotEmpty) { | ||
print('Allows:'); | ||
} | ||
// Print the path expressions allowed by this ruleset | ||
// Print the path expressions allowed by this ruleset. | ||
for (final rule in ruleset.allows) { | ||
print(' - ${rule.expression}'); | ||
} | ||
if (ruleset.disallows.isNotEmpty) { | ||
print('Disallows:'); | ||
} | ||
// Print the path expressions disallowed by this ruleset | ||
// Print the path expressions disallowed by this ruleset. | ||
for (final rule in ruleset.disallows) { | ||
print(' - ${rule.expression}'); | ||
} | ||
} | ||
// False, it cannot | ||
// False: it cannot. | ||
print(robots.canVisitPath('/gist/', userAgent: '*')); | ||
// True, it can | ||
// True: it can. | ||
print(robots.canVisitPath('/wordcollector/robots_txt', userAgent: '*')); | ||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/// Taking the singular form of [word], morph it according to [count] | ||
/// Taking the singular form of [word], morphs it according to [count]. | ||
String pluralise(String word, int count) => '${count == 0 ? 'no' : count} ' | ||
'${count == 0 || count > 1 ? '${word}s' : word}'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters