I would like to automate updating from SourceForge. This was working for a while
http://sourceforge.net/projects/msys2/rss?path=/Base/x86_64
However I realized that the RSS feed has a max of 100 items. So if the chosen
path was last updated before that then it will not be on RSS, and will return
500 Internal Server Error
ยง File Releases
So can I access a SourceForge file list with another "API"? I would prefer to
not have to scrape the page like an animal.
This is a workaround, but PowerShell can easily parse HTML
$base = Invoke-WebRequest 'http://sourceforge.net/projects/msys2/files/Base/x86_64'
Example, get latest file
$base.Links | ? class -eq name | select -fir 1 -exp href
Get latest file matching tar
$base.Links | ? href -match tar | select -fir 1 -exp href
Related
I have 700 news feeds that I need to scan for the keyword/string "Linux" occurring in either title or the content of each new post.
I found how to filter in the docs
news docs
( title =~ "Linux" or content =~ "Linux" )
but I cannot find any indication of how to go the next step and push the message into another folder.
If possible, I am trying to work within the newsbeuter system because right now it opens up firefox perfectly for urls, I just want to avoid scrolling 700 folders.
config:
use-proxy yes
proxy yoda.server.com:3128
browser firefox
How do you filter and move and post based on string in newsbeuter?
Unfortunatelly, Newsbeuter doesn't support any kind of mass-refiling (yet), so what you're asking for can't be done.
I am quite new to writing Behat test suites and I am currently trying to flesh out my existing feature file with an added test to test an uploaded file.
This is what I have come up with so far.
Scenario: Submitting a valid asset form and uploading a file
When I submit a asset form with values:
| name | type | position | active | file |
| St Andrews Release | image | 1 | 1 | /web/images/product/icon/default.jpg |
Then the form should be valid
And the entity form entity should have the following values
| name | type | position | active | file |
| St Andrews Release | image | 1 | 1 | /web/images/product/icon/default.jpg |
Failed asserting that null matches expected '/web/images/product/icon/default.jpg'.
And the entity form entity should be persisted correctly
This is the method handling the scenario:
/**
* #When I submit a asset form with values:
*/
public function iSubmitAssetFormWithValues(TableNode $table)
{
$data = $table->getColumnsHash()[0];
$this->form = $this->submitTheForm('crmpicco.asset.type', $this->entity, $data);
}
The submitTheForm method returns a Symfony\Component\Form\FormInterface.
Am I along the right lines? I am currently getting an error:
Failed asserting that null matches expected
'/web/images/product/swatch/default.jpg'.
I suggest you to create a dedicated folder structure for files which will be used in behat tests right in your application root because tests and the files used in tests must be consistent for all developers. I sometimes see people writing tests to upload files that exist on their local desktop:) My desktop and your desktop would be different hence reason the test would fail.
Structure
football #your application name/root
build
dummy
document
hello.doc
world.xls
image
test.jpg
behat.yml
Apart from other common setting, you must define file_path.
....
....
default:
extensions:
Behat\MinkExtension\Extension:
files_path: %behat.paths.base%/build/dummy/
....
....
Example Gherkin scenario
Feature: I can upload a file which is stored in my generic "dummy" folder
Scenario: I can upload image
Given I am on "/"
When I attach the file "image/test.jpg" to "league_flag"
And I press "Submit"
Then I should see "Succeeded."
Let's say I have a directory with the following contents:
/Project.Presentation
/Project.Presentation.API
/Project.Presentation.Web
/Project.Presentation.Infra
/Project.Presentation.Util
I want to do this -> Project.Presentation: API and let it autocomplete to Project.Presentation.API. Inside Project.Presentation to type API and <tab>.
Is it possible to let zsh use this 'forgiving' way of ?
You're overcomplicating your solution.
If you want to execute a command with a file inside these directories, or just cd in one of these directories.
Just write cd (or other command) first, then press tab that will complete Project.Presentation. then you can either write API or write A and press tab.
By the way, you can have a way to navigate through the possibilities with an extra tab key.
Read man zshoptions for to discover options available in zsh.
I want to make a batch file that will ask user for input, than write that input to a specific position in an already written txt file(called commands.txt which contains query) and call sqlite3 < commands.txt
I need this so inside the commands.txt where the query is, in LIKE 'userinput' i will add the users choice (parameter)
Although your question is not really specific enough and verging on the kind of inappropriate question that for stackoverflow (it does not include code), as hinted at by the comment, I'll take it at face value and assume there is much you need help with.
First let me deal with the question "I need to make a batch file"
A batch file is a simple text file with the extension .bat. You can create it with a text editor like notepad. We do not know what kind of system you have (Windows, linux, Mac etc) but lets assume Windows as you asked for a batch file. We do not know which version of windows (7 or 8 etc), So I'll try and be generic.
All windows machines come with a simpe text file editor called notepad. You can open this by typing notepad into the search box on windows 7 or 8. Lets start with a simple batch file:
:: This is a batch file
#echo off
echo Hello World
exit /b
Type (or paste) those 4 lines into notepad. Now select the file menu and select Save As, now in the Save As Type: selector choose All Files. In the File name: box type the desired name with the bat extension, such as doit.bat. Ensure you choose a suitable directory to place your new batch file. Leave the encoding as ASCII. Click Save. You have now made your first batch file.
Now you need to execute that batch file. Using the Windows File Explorer find the folder where you saved that batch file. While viewing the folder, hold down the shift key on the keyboard and then right click in the background of the folder and select Open Command window here. You will now have a command prompt window. You can now execute your new batch file by typing its name doit. It will display:
Hello World
OK - Now you have created your first working batch file.
Now for the next part; Asking the user for input. This is done with the set /p command. Add this to your batch file (before the exit line):
Set /P Like="Give me your input: "
echo Your input was: %Like%
That has solved the second part. Now the third part, edit the commands.txt file. If you do an internet search for a similar problem (editing files in batch files) you might find this help page: http://www.ousob.com/ng/edlin/ng96d9.php. This shows a generic way of changing any text string to any other in a file using EDLIN from a batch file; unfortunately EDLIN (and EDIT) are no longer included in windows so these batch files are not much help.
A search of stackoverflow finds similar queries which contain an answer for you.
So now you have all the parts of the answer:
How to make a batch file
How to prompt the user for input
How to replace lines of text in the commands.txt
You should be able to put it together and get it to work....
I track my billable hours. Every item has a description and a number of tags for different clients, projects etc.
Recently I added zsh completion for these tags. This is what I have in my zsh autocompletion file now:
_arguments "*:tags:( $(cat timetrackingdata | extract_tags.py ) )"
The python script extract_tags.py extracts all tags in my timetrackingdata file and gives them back to zsh.
I'd like to able to limit the tags returned by the tags already on the command line
So if I've already put the tag client1 on the command line I want to pass this tag to extract_tags.py so that it can filter it's output and only return tags that occur on items that also have the tag client1.
I think what you are looking for is the $words variable. This is an array of all words specified on the command line that magically exists inside completion functions.
Where is that documented? There are some passing references in man zshcompsys that I would have missed were I not specifically looking for them. However, I found it more clearly highlighted on this website.