From 2f7d3a5cc05ede401f1d9110141627ac616d640c Mon Sep 17 00:00:00 2001 From: ruidajo Date: Sun, 15 Sep 2024 18:08:28 -0500 Subject: [PATCH] Improving baseline, Creating Instagram downloader default. --- .../BaselineOfInstagramPharo.class.st | 11 ++++--- BaselineOfInstagramPharo/package.st | 2 +- Instagram/InstagramDownloader.class.st | 17 ++++++++++ Instagram/InstagramUrl.class.st | 31 +++++++++---------- Instagram/package.st | 2 +- 5 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 Instagram/InstagramDownloader.class.st diff --git a/BaselineOfInstagramPharo/BaselineOfInstagramPharo.class.st b/BaselineOfInstagramPharo/BaselineOfInstagramPharo.class.st index 2d7e326..39cd80a 100644 --- a/BaselineOfInstagramPharo/BaselineOfInstagramPharo.class.st +++ b/BaselineOfInstagramPharo/BaselineOfInstagramPharo.class.st @@ -1,11 +1,10 @@ Class { - #name : 'BaselineOfInstagramPharo', - #superclass : 'BaselineOf', - #category : 'BaselineOfInstagramPharo', - #package : 'BaselineOfInstagramPharo' + #name : #BaselineOfInstagramPharo, + #superclass : #BaselineOf, + #category : #BaselineOfInstagramPharo } -{ #category : 'baselines' } +{ #category : #baselines } BaselineOfInstagramPharo >> baseline: spec [ @@ -13,6 +12,8 @@ BaselineOfInstagramPharo >> baseline: spec [ for: #common do: [ spec package: 'Instagram'; + package: 'ExtEnvi'; + package: 'Instagram' with: [ spec requires: #('ExtEnvi') ]; package: 'Instagram-Tests' with: [ spec requires: #('Instagram') ]; group: 'default' with: #('core' 'tests'); group: 'core' with: #('Instagram'); diff --git a/BaselineOfInstagramPharo/package.st b/BaselineOfInstagramPharo/package.st index f612ec9..58d1300 100644 --- a/BaselineOfInstagramPharo/package.st +++ b/BaselineOfInstagramPharo/package.st @@ -1 +1 @@ -Package { #name : 'BaselineOfInstagramPharo' } +Package { #name : #BaselineOfInstagramPharo } diff --git a/Instagram/InstagramDownloader.class.st b/Instagram/InstagramDownloader.class.st new file mode 100644 index 0000000..1056431 --- /dev/null +++ b/Instagram/InstagramDownloader.class.st @@ -0,0 +1,17 @@ +Class { + #name : #InstagramDownloader, + #superclass : #Object, + #category : #Instagram +} + +{ #category : #'as yet unclassified' } +InstagramDownloader >> initialize [ + super initialize. +] + +{ #category : #'as yet unclassified' } +InstagramDownloader >> installDefault [ + | py | + py := PyEnv new. + py createEnv: 'InstagramDownloader' in: FileLocator documents +] diff --git a/Instagram/InstagramUrl.class.st b/Instagram/InstagramUrl.class.st index 781a3f7..223b7a0 100644 --- a/Instagram/InstagramUrl.class.st +++ b/Instagram/InstagramUrl.class.st @@ -4,17 +4,16 @@ I manage instagram URLs information. InstagramUrl newURL: 'https://instagram.com/restOfURL' " Class { - #name : 'InstagramUrl', - #superclass : 'Object', + #name : #InstagramUrl, + #superclass : #Object, #instVars : [ 'url', 'type' ], - #category : 'Instagram', - #package : 'Instagram' + #category : 'Instagram' } -{ #category : 'instance creation' } +{ #category : #'instance creation' } InstagramUrl class >> newURL: url [ | instance | instance := self new. @@ -23,7 +22,7 @@ InstagramUrl class >> newURL: url [ ^ instance ] -{ #category : 'initialization' } +{ #category : #initialization } InstagramUrl >> initialize [ super initialize. @@ -33,7 +32,7 @@ InstagramUrl >> initialize [ ] -{ #category : 'testing' } +{ #category : #testing } InstagramUrl >> isRootUrl [ | segments | @@ -45,7 +44,7 @@ InstagramUrl >> isRootUrl [ ^ true ] -{ #category : 'testing' } +{ #category : #testing } InstagramUrl >> isUserUrl [ | segments | @@ -57,12 +56,12 @@ InstagramUrl >> isUserUrl [ ^ true ] -{ #category : 'opening' } +{ #category : #opening } InstagramUrl >> openWithoutTracking [ WebBrowser openOn: self urlWithoutTracking ] -{ #category : 'initialization' } +{ #category : #initialization } InstagramUrl >> setTypeByUrl [ self isRootUrl ifTrue: [ type := 'root'. ^ self ]. @@ -71,13 +70,13 @@ InstagramUrl >> setTypeByUrl [ ^ self ] -{ #category : 'accessing' } +{ #category : #accessing } InstagramUrl >> type [ ^ type ] -{ #category : 'accessing' } +{ #category : #accessing } InstagramUrl >> type: aType [ (self urlTypes includes: aType) ifTrue: [ @@ -88,13 +87,13 @@ InstagramUrl >> type: aType [ ^ self setTypeByUrl ] -{ #category : 'accessing' } +{ #category : #accessing } InstagramUrl >> url [ ^ url ifNil: [ url := 'https://instagram.com/' asUrl ] ] -{ #category : 'accessing' } +{ #category : #accessing } InstagramUrl >> url: anURLString [ | urlCheck | @@ -109,14 +108,14 @@ InstagramUrl >> url: anURLString [ url := urlCheck ] -{ #category : 'accessing - data' } +{ #category : #'accessing - data' } InstagramUrl >> urlTypes [ "I have the collection of correct types." ^ { 'root' . 'user' } ] -{ #category : 'accessing' } +{ #category : #accessing } InstagramUrl >> urlWithoutTracking [ ^ self url queryRemoveAll; asStringOrText ] diff --git a/Instagram/package.st b/Instagram/package.st index 3b001b5..898c19b 100644 --- a/Instagram/package.st +++ b/Instagram/package.st @@ -1 +1 @@ -Package { #name : 'Instagram' } +Package { #name : #Instagram }