Creating nitter user collection of urls for load more tweets and default config folder.
This commit is contained in:
parent
311c422216
commit
5b169c4ebf
@ -0,0 +1,5 @@
|
||||
accessing
|
||||
defaultConfig
|
||||
|
||||
self config: { 'folder' -> (FileLocator userData / 'Socialmetrica' / self userName) } asDictionary.
|
||||
^ self config
|
@ -0,0 +1,18 @@
|
||||
accessing
|
||||
numberOfURLsForLoadingTweets: number
|
||||
|
||||
| collectionURLs count asURLs |
|
||||
collectionURLs := {
|
||||
self userNameLink .
|
||||
(self userNameLink, ((self documentTree xPath: '//a[.="Load more"]') @ 'href') stringValue) .} asOrderedCollection.
|
||||
|
||||
number <= 2 ifTrue: [ ^ collectionURLs ].
|
||||
count := 2.
|
||||
(number-count) timesRepeat: [ | tempDoc |
|
||||
tempDoc := XMLHTMLParser parse: (collectionURLs at: count) asUrl retrieveContents.
|
||||
collectionURLs
|
||||
add: (self userNameLink,
|
||||
((tempDoc xPath: '//a[.="Load more"]') @ 'href') stringValue).
|
||||
count := count+1 ].
|
||||
asURLs := collectionURLs collect: [ :string | string asUrl ].
|
||||
^ asURLs.
|
Loading…
Reference in New Issue
Block a user