Compare commits

..

No commits in common. "09df2285f789f01c110cd33ef2bceb0c2b37758e" and "f571ac62788145d683262c711aa6dc81c2d21015" have entirely different histories.

5 changed files with 23 additions and 79 deletions

View File

@ -1,10 +1,11 @@
Class {
#name : #BaselineOfInstagramPharo,
#superclass : #BaselineOf,
#category : #BaselineOfInstagramPharo
#name : 'BaselineOfInstagramPharo',
#superclass : 'BaselineOf',
#category : 'BaselineOfInstagramPharo',
#package : 'BaselineOfInstagramPharo'
}
{ #category : #baselines }
{ #category : 'baselines' }
BaselineOfInstagramPharo >> baseline: spec [
<baseline>
@ -12,8 +13,6 @@ 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

@ -1,56 +0,0 @@
Class {
#name : #InstagramDownloader,
#superclass : #Object,
#instVars : [
'bin',
'profiles'
],
#category : #Instagram
}
{ #category : #'as yet unclassified' }
InstagramDownloader >> downloadProfile: anInstProfileName [
| profiles |
profiles := (FileLocator documents / 'InstagramDownloader' / 'Profiles') ensureCreateDirectory.
^ GtSubprocessWithInMemoryOutput new
workingDirectory: profiles;
command: bin fullName;
arguments: {anInstProfileName.
'--no-videos'.
'--no-compress-json'};
runAndWait;
stdout
]
{ #category : #'as yet unclassified' }
InstagramDownloader >> initialize [
super initialize.
]
{ #category : #'as yet unclassified' }
InstagramDownloader >> installDefault [
| py doc location |
doc := FileLocator documents.
location := (doc / 'InstagramDownloader') ensureCreateDirectory.
py := PyEnv new.
py createEnv: 'InstagramDownloader' in: doc.
py install: 'instaloader' in: 'InstagramDownloader'.
bin := location / 'bin' / 'instaloader'.
]
{ #category : #accessing }
InstagramDownloader >> loadDefault [
| temp |
temp := FileLocator documents / 'InstagramDownloader'.
bin := temp / 'bin' / 'instaloader'.
profiles := temp / 'Profiles'
]
{ #category : #'as yet unclassified' }
InstagramDownloader >> profiles [
| location |
profiles
ifNil: [ location := bin parent parent / 'Profiles'.
location exists ifFalse: [ ^ profiles := location ensureCreateDirectory ] ].
^ profiles
]

View File

@ -4,16 +4,17 @@ 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'
#category : 'Instagram',
#package : 'Instagram'
}
{ #category : #'instance creation' }
{ #category : 'instance creation' }
InstagramUrl class >> newURL: url [
| instance |
instance := self new.
@ -22,7 +23,7 @@ InstagramUrl class >> newURL: url [
^ instance
]
{ #category : #initialization }
{ #category : 'initialization' }
InstagramUrl >> initialize [
super initialize.
@ -32,7 +33,7 @@ InstagramUrl >> initialize [
]
{ #category : #testing }
{ #category : 'testing' }
InstagramUrl >> isRootUrl [
| segments |
@ -44,7 +45,7 @@ InstagramUrl >> isRootUrl [
^ true
]
{ #category : #testing }
{ #category : 'testing' }
InstagramUrl >> isUserUrl [
| segments |
@ -56,12 +57,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 ].
@ -70,13 +71,13 @@ InstagramUrl >> setTypeByUrl [
^ self
]
{ #category : #accessing }
{ #category : 'accessing' }
InstagramUrl >> type [
^ type
]
{ #category : #accessing }
{ #category : 'accessing' }
InstagramUrl >> type: aType [
(self urlTypes includes: aType) ifTrue: [
@ -87,13 +88,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 |
@ -108,14 +109,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' }