Improving baseline, Creating Instagram downloader default.

This commit is contained in:
ruidajo 2024-09-15 18:08:28 -05:00
parent f571ac6278
commit 2f7d3a5cc0
5 changed files with 40 additions and 23 deletions

View File

@ -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 [
<baseline>
@ -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');

View File

@ -1 +1 @@
Package { #name : 'BaselineOfInstagramPharo' }
Package { #name : #BaselineOfInstagramPharo }

View File

@ -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
]

View File

@ -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
]

View File

@ -1 +1 @@
Package { #name : 'Instagram' }
Package { #name : #Instagram }